Explorar el Código

Explicit check for negative positions in PHYSFS_seek().

Ryan C. Gordon hace 24 años
padre
commit
2ea6feeb2b
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      physfs.c

+ 1 - 0
physfs.c

@@ -1281,6 +1281,7 @@ int PHYSFS_seek(PHYSFS_file *handle, int pos)
     assert(h != NULL);
     assert(h != NULL);
     assert(h->funcs != NULL);
     assert(h->funcs != NULL);
     BAIL_IF_MACRO(h->funcs->seek == NULL, ERR_NOT_SUPPORTED, 0);
     BAIL_IF_MACRO(h->funcs->seek == NULL, ERR_NOT_SUPPORTED, 0);
+    BAIL_IF_MACRO(pos < 0, ERR_INVALID_ARGUMENT, 0);
     return(h->funcs->seek(h, pos));
     return(h->funcs->seek(h, pos));
 } /* PHYSFS_seek */
 } /* PHYSFS_seek */