Add back the check for overflow on length

This commit is contained in:
brectanus 2007-03-07 16:54:41 +00:00
parent 9b56d63145
commit 8898759c47

View File

@ -211,7 +211,9 @@ int parse_arguments(modsec_rec *msr, const char *s, apr_size_t inputlength,
if (s == NULL) return -1;
if (inputlength == 0) return 1;
if (inputlength < 0) return -1;
/* Check that adding one will not overflow */
if (inputlength + 1 <= 0) return -1;
buf = (char *)malloc(inputlength + 1);
if (buf == NULL) return -1;