You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
proxysql/deps/libmicrohttpd/connection.c-snprintf-overf...

21 lines
645 B

@@ -1582,11 +1582,18 @@
MHD_HTTP_HEADER_CONNECTION))) &&
(MHD_str_equal_caseless_ (pos->value,
"Keep-Alive")) ) ) )
- off += MHD_snprintf_ (&data[off],
+ {
+ int n = MHD_snprintf_ (&data[off],
size - off,
"%s: %s\r\n",
pos->header,
pos->value);
+ if (n < 0 || n >= size - off)
+ {
+ break;
+ }
+ off += n;
+ }
}
if (MHD_CONNECTION_FOOTERS_RECEIVED == connection->state)
{