summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-01-11 19:39:07 +0100
committerGravatar Nikias Bassen2023-01-11 19:39:07 +0100
commit18d4f85a5fec9171a978d9d6317ea658a55648b6 (patch)
tree778b745631f400af537a4510f89e427add0ae595
parent12a2bc0578d148dcd03d26a3a1b33bccaecfdf33 (diff)
downloadlibplist-18d4f85a5fec9171a978d9d6317ea658a55648b6.tar.gz
libplist-18d4f85a5fec9171a978d9d6317ea658a55648b6.tar.bz2
oplist: Plug another memory leak occurring on parse error
Credit to OSS-Fuzz
-rw-r--r--fuzz/oplist-leaks/clusterfuzz-testcase-minimized-oplist_fuzzer-64974369884733441
-rw-r--r--src/oplist.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/fuzz/oplist-leaks/clusterfuzz-testcase-minimized-oplist_fuzzer-6497436988473344 b/fuzz/oplist-leaks/clusterfuzz-testcase-minimized-oplist_fuzzer-6497436988473344
new file mode 100644
index 0000000..9d68933
--- /dev/null
+++ b/fuzz/oplist-leaks/clusterfuzz-testcase-minimized-oplist_fuzzer-6497436988473344
@@ -0,0 +1 @@
+" \ No newline at end of file
diff --git a/src/oplist.c b/src/oplist.c
index 168c921..0ad1d1c 100644
--- a/src/oplist.c
+++ b/src/oplist.c
@@ -742,6 +742,7 @@ static int node_from_openstep(parse_ctx ctx, plist_t *plist)
ctx->pos++;
}
if (ctx->pos >= ctx->end) {
+ plist_free_data(data);
PLIST_OSTEP_ERR("EOF while parsing quoted string at offset %ld\n", ctx->pos - ctx->start);
ctx->err++;
goto err_out;