summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-26 14:31:48 +0000
committerpfg <pfg@FreeBSD.org>2016-04-26 14:31:48 +0000
commit0b059a31350e9823c37631e1919631789dcf2d8a (patch)
tree43dd0fc9a12ba8659982ef4975b06d2046d8528e /bin
parent6cf149ba99d9dcc8dfe6cbfb47234e22a42e38fa (diff)
downloadFreeBSD-src-0b059a31350e9823c37631e1919631789dcf2d8a.zip
FreeBSD-src-0b059a31350e9823c37631e1919631789dcf2d8a.tar.gz
ed(1): switch two statements so we check the index before dereferencing.
This is related to r270256 but was missed in that occasion. MFC after: 3 days
Diffstat (limited to 'bin')
-rw-r--r--bin/ed/cbc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ed/cbc.c b/bin/ed/cbc.c
index 80ed95a..3985721 100644
--- a/bin/ed/cbc.c
+++ b/bin/ed/cbc.c
@@ -257,7 +257,7 @@ expand_des_key(char *obuf, char *kbuf)
/*
* now translate it, bombing on any illegal binary digit
*/
- for (i = 0; kbuf[i] && i < 16; i++)
+ for (i = 0; i < 16 && kbuf[i]; i++)
if ((nbuf[i] = hex_to_binary((int) kbuf[i], 2)) == -1)
des_error("bad binary digit in key");
while (i < 64)
OpenPOWER on IntegriCloud