]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-mem.c
Don't crash when the last fragment is of zero length.
[libucw.git] / lib / fb-mem.c
index 54fe8bfad74a646268ce70eb75f52fc167842315..d5e6e8b96f4e54bfd4b70fd4d6ae02849a7e8849 100644 (file)
@@ -46,6 +46,8 @@ fbmem_refill(struct fastbuf *f)
       f->pos += b->size;
       b = b->next;
     }
+  if (!b->size)
+    return 0;
   f->buffer = f->bptr = b->data;
   f->bufend = f->bstop = b->data + b->size;
   f->llpos = b;