summaryrefslogtreecommitdiffstats
path: root/src/oplist.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2026-11-05 12:02:11 +0100
committerGravatar Nikias Bassen2026-11-05 12:02:11 +0100
commit9d238e5e1a55a126c8d19d644a5a2a9c305eb564 (patch)
treed223ed27ff83ef897e55e5f6fd5e5b087ccec075 /src/oplist.c
parent9fd3406baec5997d386cdb4c7492117604ba0a70 (diff)
downloadlibplist-9d238e5e1a55a126c8d19d644a5a2a9c305eb564.tar.gz
libplist-9d238e5e1a55a126c8d19d644a5a2a9c305eb564.tar.bz2
oplist: detect errors when parsing 'strings' dataHEADmaster
plist_from_openstep() tested ctx.err > 0 after parsing the plist as 'strings' data, but error codes are negative, so a failure was never detected and the function returned success with a NULL plist (leaking the temporary dict). Check for any error and return it.
Diffstat (limited to 'src/oplist.c')
-rw-r--r--src/oplist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/oplist.c b/src/oplist.c
index 51af4df..977427d 100644
--- a/src/oplist.c
+++ b/src/oplist.c
@@ -1063,10 +1063,10 @@ plist_err_t plist_from_openstep(const char *plist_ostep, uint32_t length, plist_
}
ctx.pos = plist_ostep;
parse_dict_data(&ctx, pl);
- if (ctx.err > 0) {
+ if (ctx.err != PLIST_ERR_SUCCESS) {
plist_free(pl);
PLIST_OSTEP_ERR("Failed to parse strings data\n");
- err = PLIST_ERR_PARSE;
+ err = ctx.err;
} else {
*plist = pl;
}