diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-30 21:20:50 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-30 21:20:50 +0000 |
commit | 8e7ac75623e8013343e9aba3477ab09e7bfb41fd (patch) | |
tree | 0839a35d5d59c895fce2e57741dc88d7a9d6fff7 /usr.bin/signify/signify.c | |
parent | e913a94c1f66058fd01e013c53309985312691d8 (diff) |
don't assign variables in if() that's not error checking
Diffstat (limited to 'usr.bin/signify/signify.c')
-rw-r--r-- | usr.bin/signify/signify.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index 2c34f4adb8b..4c33f6b9fc8 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.89 2014/05/30 21:17:42 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.90 2014/05/30 21:20:49 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org> * @@ -380,7 +380,8 @@ sign(const char *seckeyfile, const char *msgfile, const char *sigfile, explicit_bzero(&enckey, sizeof(enckey)); memcpy(sig.pkalg, PKALG, 2); - if ((secname = strstr(seckeyfile, ".sec")) && strlen(secname) == 4) { + secname = strstr(seckeyfile, ".sec"); + if (secname && strlen(secname) == 4) { if (snprintf(sigcomment, sizeof(sigcomment), VERIFYWITH "%.*s.pub", (int)strlen(seckeyfile) - 4, seckeyfile) >= sizeof(sigcomment)) errx(1, "comment too long"); @@ -456,7 +457,8 @@ readpubkey(const char *pubkeyfile, struct pubkey *pubkey, const char *safepath = "/etc/signify/"; if (!pubkeyfile) { - if ((pubkeyfile = strstr(sigcomment, VERIFYWITH))) { + pubkeyfile = strstr(sigcomment, VERIFYWITH); + if (pubkeyfile) { pubkeyfile += strlen(VERIFYWITH); if (strncmp(pubkeyfile, safepath, strlen(safepath)) != 0 || strstr(pubkeyfile, "/../") != NULL) |