decoder: check length==0 in decoder_read()
When the caller passes length==0, decoder_read() entered an endless loop. Check that condition before entering the "while" loop.
This commit is contained in:
@@ -106,6 +106,9 @@ size_t decoder_read(struct decoder *decoder,
|
||||
assert(is != NULL);
|
||||
assert(buffer != NULL);
|
||||
|
||||
if (length == 0)
|
||||
return 0;
|
||||
|
||||
while (true) {
|
||||
/* XXX don't allow decoder==NULL */
|
||||
if (decoder != NULL &&
|
||||
|
||||
Reference in New Issue
Block a user