Commit 7bd145fd authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix out of bound array access in decode_length

parent f7389ff2
......@@ -438,7 +438,7 @@ static uint8_t* decode_length(ssize_t *res, uint8_t *in, uint8_t *last,
break;
}
}
if(*in & (1 << 7)) {
if(in == last || *in & (1 << 7)) {
*res = -1;
return NULL;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment