Fix out of bound array access in decode_length

This commit is contained in:
Tatsuhiro Tsujikawa 2013-10-18 19:30:04 +09:00
parent f7389ff2e6
commit 7bd145fd23
1 changed files with 1 additions and 1 deletions

View File

@ -438,7 +438,7 @@ static uint8_t* decode_length(ssize_t *res, uint8_t *in, uint8_t *last,
break; break;
} }
} }
if(*in & (1 << 7)) { if(in == last || *in & (1 << 7)) {
*res = -1; *res = -1;
return NULL; return NULL;
} else { } else {