diff options
| author | 2026-07-29 14:25:18 +0900 | |
|---|---|---|
| committer | 2026-09-29 16:43:02 +0200 | |
| commit | bd68e726e45c10fd223814eaf6129e1bb2f7b022 (patch) | |
| tree | 139a2eba6ddd6d555fbd89bcbe75aadaaa3d0d01 /test/signedunsigned1.test | |
| parent | be3a7ff2862868b4612d4c56edbd42e1d7dd7fdb (diff) | |
| download | libplist-bd68e726e45c10fd223814eaf6129e1bb2f7b022.tar.gz libplist-bd68e726e45c10fd223814eaf6129e1bb2f7b022.tar.bz2 | |
plist: fix inverted strcmp in string to boolean conversion
plist_dict_get_bool() compared the string value with strcmp() but treated a
non-zero return as a match. strcmp() returns 0 on equality, so the conditions
were inverted: "true" produced 0, "false" produced 1, and any other string
also produced 1. The error branch could never be reached, since it required
both comparisons to return 0 at once.
The result is that the API returns the opposite of the stored value for both
valid boolean strings, and returns true for strings that are not booleans at
all, instead of reporting the conversion error.
Compare == 0 in both conditions:
input before after
true 0 1
false 1 0
not-a-bool 1 error
TRUE 1 error
(empty) 1 error
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Diffstat (limited to 'test/signedunsigned1.test')
0 files changed, 0 insertions, 0 deletions
