summaryrefslogtreecommitdiffstats
path: root/src/plist.c
diff options
context:
space:
mode:
authorGravatar Nicolás Alvarez2012-09-16 21:22:39 +0200
committerGravatar Nikias Bassen2012-09-16 21:22:39 +0200
commitc9382f08d1fec4951b9acea9345ddd64cd619d56 (patch)
tree8ee8ad13e1c84fd3a25bf9db1c7eddba30c4b0f2 /src/plist.c
parent502d52a3232bfc66a56acfc67e17f9d836b6cb67 (diff)
downloadlibplist-c9382f08d1fec4951b9acea9345ddd64cd619d56.tar.gz
libplist-c9382f08d1fec4951b9acea9345ddd64cd619d56.tar.bz2
plist_data_compare: for PLIST_DATA, compare length before accessing data
Diffstat (limited to 'src/plist.c')
-rw-r--r--src/plist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plist.c b/src/plist.c
index ee79cf4..dcaf601 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -650,6 +650,8 @@ int plist_data_compare(const void *a, const void *b)
return FALSE;
case PLIST_DATA:
+ if (val_a->length != val_b->length)
+ return FALSE;
if (!memcmp(val_a->buff, val_b->buff, val_a->length))
return TRUE;
else