fix integer overflow test to actually work
authorChristian Grothoff <christian@grothoff.org>
Fri, 10 Mar 2017 16:56:17 +0000 (17:56 +0100)
committerChristian Grothoff <christian@grothoff.org>
Fri, 10 Mar 2017 16:56:17 +0000 (17:56 +0100)
src/transport/plugin_transport_udp.c

index 76132523be12f93014d74223e3d591c778574cb1..eb48341b7660daee4b2343953e1f27c1fa3dad51 100644 (file)
@@ -1623,7 +1623,7 @@ enqueue (struct Plugin *plugin,
     GNUNET_break (0);
     return;
   }
-  if (plugin->bytes_in_buffer + udpw->msg_size > INT64_MAX)
+  if (plugin->bytes_in_buffer > INT64_MAX - udpw->msg_size)
   {
     GNUNET_break (0);
   }