pkcs15: Avoid null dereference in fuzzers
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16617
This commit is contained in:
parent
532b06d07e
commit
6522df7587
|
@ -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 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
|
* 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. */
|
* 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);
|
r = sc_pkcs15_make_absolute_path(&p15card->file_app->path, &path);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in New Issue