gsocket: Add missing preconditions to g_socket_send_message()
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 15 May 2014 11:16:00 +0000 (12:16 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 15 May 2014 13:35:19 +0000 (14:35 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=730190

gio/gsocket.c

index 6713d0a..e59ace8 100644 (file)
@@ -3746,6 +3746,11 @@ g_socket_send_message (GSocket                *socket,
   char zero;
 
   g_return_val_if_fail (G_IS_SOCKET (socket), -1);
+  g_return_val_if_fail (address == NULL || G_IS_SOCKET_ADDRESS (address), -1);
+  g_return_val_if_fail (num_vectors == 0 || vectors != NULL, -1);
+  g_return_val_if_fail (num_messages == 0 || messages != NULL, -1);
+  g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), -1);
+  g_return_val_if_fail (error == NULL || *error == NULL, -1);
 
   if (!check_socket (socket, error))
     return -1;