[PATCH] Fix null pointer dereference
Joshua Rogers
git at internot.info
Sun Jan 25 20:18:57 CET 2015
* sm/certchain.c: Correctly check return value of strpbrk to
make sure null pointer dereferences do not occur.
--
'strpbrk' may return NULL.
Signed-off-by: Joshua Rogers <git at internot.info>
---
sm/certchain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sm/certchain.c b/sm/certchain.c
index 5e632f7..f720207 100644
--- a/sm/certchain.c
+++ b/sm/certchain.c
@@ -411,7 +411,7 @@ check_cert_policy (ksba_cert_t cert, int listmode, estream_t fplist)
for (allowed=line; spacep (allowed); allowed++)
;
p = strpbrk (allowed, " :\n");
- if (!*p || p == allowed)
+ if (!p || p == allowed)
{
fclose (fp);
xfree (policies);
--
1.9.1
More information about the Gnupg-devel
mailing list