Skip to content

Commit 5a43001

Browse files
Ekaterina Orlovatorvalds
authored andcommitted
ASN.1: Fix check for strdup() success
It seems there is a misprint in the check of strdup() return code that can lead to NULL pointer dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 4520c6a ("X.509: Add simple ASN.1 grammar compiler") Signed-off-by: Ekaterina Orlova <[email protected]> Cc: David Woodhouse <[email protected]> Cc: James Bottomley <[email protected]> Cc: Jarkko Sakkinen <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: David Howells <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2af3e53 commit 5a43001

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/asn1_compiler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ int main(int argc, char **argv)
625625
p = strrchr(argv[1], '/');
626626
p = p ? p + 1 : argv[1];
627627
grammar_name = strdup(p);
628-
if (!p) {
628+
if (!grammar_name) {
629629
perror(NULL);
630630
exit(1);
631631
}

0 commit comments

Comments
 (0)