Fix potential uninitialized read

When analyzing the buffer that is handed to the first_object_id function
we carefully check to make sure that we don't read past the end of the
input buffer but there was still one code path that could have us do just
that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-12-07 20:02:14 -08:00
parent 0fcdd011f5
commit dad93c425e

View file

@ -327,7 +327,7 @@ static char *first_object_id_val(char* buf)
return NULL;
bufend = buf + strlen(buf);
object = strstr(buf, "object_id");
if (object) {
if (object && object + 14 < bufend) {
/* get the value */
char tmp[10];
char *p = object + 14;