blob: Don't set overrun if reading 0 bytes at end of data
authorJordan Justen <jordan.l.justen@intel.com>
Sat, 21 Oct 2017 09:23:30 +0000 (02:23 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Wed, 1 Nov 2017 06:36:54 +0000 (23:36 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/blob.c

index 8dd254fefc6dfe0899280af1b13a4006fbbe1df8..5e8671b7b4450b82ea8fc4151bb03801576d9c08 100644 (file)
@@ -256,7 +256,7 @@ ensure_can_read(struct blob_reader *blob, size_t size)
    if (blob->overrun)
       return false;
 
-   if (blob->current < blob->end && blob->end - blob->current >= size)
+   if (blob->current <= blob->end && blob->end - blob->current >= size)
       return true;
 
    blob->overrun = true;