strlen ran over the end of the string. Use strnlen to bound it.
Reference: http://bugs.debian.org/513516
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* updated to work with slightly modified
* ipt_string_info.
*/
+#define _GNU_SOURCE 1
#include <stdio.h>
#include <netdb.h>
#include <string.h>
else
stringinfo->u.v1.flags |= XT_STRING_FLAG_INVERT;
}
- stringinfo->patlen=strlen((char *)&stringinfo->pattern);
+ stringinfo->patlen = strnlen((char *)&stringinfo->pattern,
+ sizeof(stringinfo->patlen));
*flags |= STRING;
break;