pkcs15: Avoid null dereference in fuzzers

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16617
This commit is contained in:
Jakub Jelen 2019-10-25 17:10:52 +02:00 committed by Frank Morgner
parent 532b06d07e
commit 6522df7587
1 changed files with 1 additions and 1 deletions

View File

@ -2290,7 +2290,7 @@ sc_pkcs15_parse_unusedspace(const unsigned char *buf, size_t buflen, struct sc_p
/* If the path length is 0, it's a dummy path then don't add it.
* If the path length isn't included (-1) then it's against the standard
* but we'll just ignore it instead of returning an error. */
if (path.count > 0) {
if (path.count > 0 && p15card->file_app) {
r = sc_pkcs15_make_absolute_path(&p15card->file_app->path, &path);
if (r < 0)
return r;