Commit c5173d46 authored by Nikias Bassen's avatar Nikias Bassen

bplist: fix invalid memory access in copy_plist_data

parent 33b8dfb9
...@@ -521,12 +521,12 @@ static void* copy_plist_data(const void* src) ...@@ -521,12 +521,12 @@ static void* copy_plist_data(const void* src)
break; break;
case PLIST_DATA: case PLIST_DATA:
case PLIST_ARRAY: case PLIST_ARRAY:
dstdata->buff = (uint8_t *) malloc(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); memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length);
break; break;
case PLIST_DICT: case PLIST_DICT:
dstdata->buff = (uint8_t *) malloc(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); memcpy(dstdata->buff, srcdata->buff, sizeof(uint8_t) * srcdata->length * 2);
break; break;
default: default:
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment