summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2009-07-16 23:24:13 +0200
committerRob Crittenden <rcritten@redhat.com>2009-08-28 17:20:15 -0400
commit702923a832e2200a59bbe3888129afea0acf039e (patch)
tree4bc4c4dafff2b4db063763c775b23891897193db
parent99286597662891ac69146fce6590a435331938cd (diff)
downloadpemnss-702923a832e2200a59bbe3888129afea0acf039e.zip
pemnss-702923a832e2200a59bbe3888129afea0acf039e.tar.gz
pemnss-702923a832e2200a59bbe3888129afea0acf039e.tar.xz
do not crash when using malformed key file
Resolves 512019
-rw-r--r--util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util.c b/util.c
index 319a870..a6ca094 100644
--- a/util.c
+++ b/util.c
@@ -168,9 +168,13 @@ ReadDERFromFile(SECItem *** derlist, char *filename, PRBool ascii,
key = 1;
c = body;
body = strchr(body, '\n');
+ if (NULL == body)
+ goto loser;
body++;
if (strncmp(body, "Proc-Type: 4,ENCRYPTED", 22) == 0) {
body = strchr(body, '\n');
+ if (NULL == body)
+ goto loser;
body++;
if (strncmp(body, "DEK-Info: ", 10) == 0) {
body += 10;