aboutsummaryrefslogtreecommitdiff
path: root/examples/zran.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2024-02-02 13:39:10 -0800
committerMark Adler <madler@alumni.caltech.edu>2024-02-04 18:48:30 -0800
commitbe4db0a79add326bf06ff46b550f564288749f90 (patch)
treee0b89cf21a370b9a08f6abcbed6899ed4b880b7a /examples/zran.h
parentf1f503da85d52e56aae11557b4d79a42bcaa2b86 (diff)
downloadzlib-be4db0a79add326bf06ff46b550f564288749f90.tar.gz
zlib-be4db0a79add326bf06ff46b550f564288749f90.tar.bz2
zlib-be4db0a79add326bf06ff46b550f564288749f90.zip
Set returned index to NULL on an index build error in zran.c.
An attempt to use the returned pointer in deflate_index_extract() will now return cleanly with an error. The returned pointer can now also be used with deflate_index_free() even on error.
Diffstat (limited to 'examples/zran.h')
-rw-r--r--examples/zran.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/zran.h b/examples/zran.h
index ebf780d..8a332d6 100644
--- a/examples/zran.h
+++ b/examples/zran.h
@@ -30,7 +30,7 @@ struct deflate_index {
30// the number of access points on success (>= 1), Z_MEM_ERROR for out of 30// the number of access points on success (>= 1), Z_MEM_ERROR for out of
31// memory, Z_BUF_ERROR for a premature end of input, Z_DATA_ERROR for a format 31// memory, Z_BUF_ERROR for a premature end of input, Z_DATA_ERROR for a format
32// or verification error in the input file, or Z_ERRNO for a file read error. 32// or verification error in the input file, or Z_ERRNO for a file read error.
33// On success, *built points to the resulting index. 33// On success, *built points to the resulting index, otherwise it's NULL.
34int deflate_index_build(FILE *in, off_t span, struct deflate_index **built); 34int deflate_index_build(FILE *in, off_t span, struct deflate_index **built);
35 35
36// Use the index to read len bytes from offset into buf. Return the number of 36// Use the index to read len bytes from offset into buf. Return the number of