From 9d238e5e1a55a126c8d19d644a5a2a9c305eb564 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 5 Nov 2026 12:02:11 +0100 Subject: oplist: detect errors when parsing 'strings' data 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. --- src/oplist.c | 4 ++-- 1 file 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; } -- cgit v1.1-32-gdbae