diff options
| -rw-r--r-- | src/plist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plist.c b/src/plist.c index 6197e3d..1eaa4e6 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -593,10 +593,10 @@ static plist_t plist_copy_node(node_t node) | |||
| 593 | case PLIST_KEY: | 593 | case PLIST_KEY: |
| 594 | case PLIST_STRING: | 594 | case PLIST_STRING: |
| 595 | if (data->strval) { | 595 | if (data->strval) { |
| 596 | size_t n = strlen(data->strval) + 1; | 596 | size_t n = strlen(data->strval); |
| 597 | newdata->strval = (char*)malloc(n); | 597 | newdata->strval = (char*)malloc(n+1); |
| 598 | assert(newdata->strval); | 598 | assert(newdata->strval); |
| 599 | memcpy(newdata->strval, data->strval, n); | 599 | memcpy(newdata->strval, data->strval, n+1); |
| 600 | newdata->length = (uint64_t)n; | 600 | newdata->length = (uint64_t)n; |
| 601 | } else { | 601 | } else { |
| 602 | newdata->strval = NULL; | 602 | newdata->strval = NULL; |
