GNOME Bugzilla – Bug 667225
GSocket: add missing type checks to public methods
Last modified: 2012-01-04 16:17:11 UTC
Although passing NULL as a socket can be considered a user error, gio shouldn't crash and check_socket() will certainly do if NULL is passed. Safeguard against this.
Created attachment 204533 [details] [review] GSocket: add missing type checks to public methods
Comment on attachment 204533 [details] [review] GSocket: add missing type checks to public methods >Although passing NULL as a socket can be considered a user error, >gio shouldn't crash and check_socket() will certainly do if NULL >is passed. Safeguard against this. The patch is fine, but the commit message is wrong. It *is* an error, not just "can be considered" one, and gio will still crash if you pass it a NULL even with this patch if you built it with G_DISABLE_CHECKS. I'd just say something like "GSocket: add some more g_return_if_fail()s"
Pushed after fixing the commit message as suggested.