summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-11 23:51:31 +0100
committerGravatar Nikias Bassen2012-02-11 23:51:31 +0100
commitc5173d46a16220a743593e28359770c54adcc65b (patch)
tree5cbee51b38b9d10cee641f4c28602c08dd431606
parent33b8dfb90ecc5b4b2559c1fb43d7b743b72bf425 (diff)
downloadlibplist-c5173d46a16220a743593e28359770c54adcc65b.tar.gz
libplist-c5173d46a16220a743593e28359770c54adcc65b.tar.bz2
bplist: fix invalid memory access in copy_plist_data
-rw-r--r--src/bplist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bplist.c b/src/bplist.c
index 43354be..eff44fc 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -521,12 +521,12 @@ static void* copy_plist_data(const void* src)
break;
case PLIST_DATA:
case PLIST_ARRAY:
- dstdata->buff = (uint8_t *) malloc(sizeof(uint8_t *) * srcdata->length);
- memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t *) * srcdata->length);
+ dstdata->buff = (uint8_t*) malloc(sizeof(uint8_t) * srcdata->length);
+ memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length);
break;
case PLIST_DICT:
- dstdata->buff = (uint8_t *) malloc(sizeof(uint8_t *) * srcdata->length * 2);
- memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t *) * srcdata->length * 2);
+ dstdata->buff = (uint8_t*) malloc(sizeof(uint8_t) * srcdata->length * 2);
+ memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length * 2);
break;
default:
break;