diff options
| author | 2026-11-05 12:02:11 +0100 | |
|---|---|---|
| committer | 2026-11-05 12:02:11 +0100 | |
| commit | 9d238e5e1a55a126c8d19d644a5a2a9c305eb564 (patch) | |
| tree | d223ed27ff83ef897e55e5f6fd5e5b087ccec075 /src | |
| parent | 9fd3406baec5997d386cdb4c7492117604ba0a70 (diff) | |
| download | libplist-9d238e5e1a55a126c8d19d644a5a2a9c305eb564.tar.gz libplist-9d238e5e1a55a126c8d19d644a5a2a9c305eb564.tar.bz2 | |
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')
| -rw-r--r-- | src/oplist.c | 4 |
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; } |
