... | ... |
@@ -1619,7 +1619,11 @@ static char *pdf_readstring(const char *q0, int len, const char *key, unsigned * |
1619 | 1619 |
cli_dbgmsg("cli_pdf: unable to allocate memory...\n"); |
1620 | 1620 |
return NULL; |
1621 | 1621 |
} |
1622 |
- cli_hex2str_to(start, s, q - start); |
|
1622 |
+ if (cli_hex2str_to(start, s, q - start)) { |
|
1623 |
+ cli_dbgmsg("cli_pdf: %s has bad hex value\n", key); |
|
1624 |
+ free(s); |
|
1625 |
+ return NULL; |
|
1626 |
+ } |
|
1623 | 1627 |
s[(q-start)/2] = '\0'; |
1624 | 1628 |
if (slen) |
1625 | 1629 |
*slen = (q - start)/2; |