... | ... |
@@ -321,7 +321,12 @@ char *pdf_finalize_string(struct pdf_struct *pdf, struct pdf_obj *obj, const cha |
321 | 321 |
} |
322 | 322 |
|
323 | 323 |
free(wrkstr); |
324 |
- wrkstr = cli_strdup(output); |
|
324 |
+ wrkstr = cli_calloc(outlen+1, sizeof(char)); |
|
325 |
+ if (!wrkstr) { |
|
326 |
+ free(output); |
|
327 |
+ return NULL; |
|
328 |
+ } |
|
329 |
+ memcpy(wrkstr, output, outlen); |
|
325 | 330 |
free(output); |
326 | 331 |
wrklen = outlen; |
327 | 332 |
} |