summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/nss/cmd/signtool/signtool.c2
-rw-r--r--security/nss/cmd/signtool/util.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/security/nss/cmd/signtool/signtool.c b/security/nss/cmd/signtool/signtool.c
index a55bddaa1..881a4e92d 100644
--- a/security/nss/cmd/signtool/signtool.c
+++ b/security/nss/cmd/signtool/signtool.c
@@ -185,7 +185,7 @@ ProcessCommandFile()
return - 1;
}
- while (pr_fgets(buf, CMD_FILE_BUFSIZE, fd), buf && *buf != '\0') {
+ while (pr_fgets(buf, CMD_FILE_BUFSIZE, fd)) {
char *eol;
linenum++;
diff --git a/security/nss/cmd/signtool/util.c b/security/nss/cmd/signtool/util.c
index 7da4a661d..be780d29b 100644
--- a/security/nss/cmd/signtool/util.c
+++ b/security/nss/cmd/signtool/util.c
@@ -1109,10 +1109,13 @@ pr_fgets(char *buf, int size, PRFileDesc *file)
i = 0;
while (i < size - 1) {
- status = PR_Read(file, (void * ) &c, 1);
+ status = PR_Read(file, &c, 1);
if (status == -1) {
return NULL;
} else if (status == 0) {
+ if (i == 0) {
+ return NULL;
+ }
break;
}
buf[i++] = c;