summaryrefslogtreecommitdiffstats
path: root/cython/plist.pxd
diff options
context:
space:
mode:
authorGravatar Arpit Jain2026-07-29 14:25:18 +0900
committerGravatar Nikias Bassen2026-09-29 16:43:02 +0200
commitbd68e726e45c10fd223814eaf6129e1bb2f7b022 (patch)
tree139a2eba6ddd6d555fbd89bcbe75aadaaa3d0d01 /cython/plist.pxd
parentbe3a7ff2862868b4612d4c56edbd42e1d7dd7fdb (diff)
downloadlibplist-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 'cython/plist.pxd')
0 files changed, 0 insertions, 0 deletions