]> granicus.if.org Git - curl/commitdiff
added a size > buffer size check to make it easier to track this in the
authorDaniel Stenberg <daniel@haxx.se>
Wed, 22 Aug 2007 14:09:13 +0000 (14:09 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 22 Aug 2007 14:09:13 +0000 (14:09 +0000)
future

tests/server/sockfilt.c

index 1c170c767f1a476c725e6ee3237cfdb98a764d2f..bd54f88122f3ff9b46e253cf110e13db02f16ebb 100644 (file)
@@ -307,6 +307,12 @@ static int juggle(curl_socket_t *sockfdp,
         }
         logmsg("> %d bytes data, server => client", buffer_len);
 
+        if(buffer_len > (ssize_t)sizeof(buffer)) {
+          logmsg("ERROR: %d bytes of data does not fit within the %d "
+                 "bytes buffer", buffer_len, sizeof(buffer));
+          return FALSE;
+        }
+
         /*
          * To properly support huge data chunks, we need to repeat the call
          * to read() until we're done or it fails.