diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-26 14:31:48 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-26 14:31:48 +0000 |
commit | 0b059a31350e9823c37631e1919631789dcf2d8a (patch) | |
tree | 43dd0fc9a12ba8659982ef4975b06d2046d8528e /bin | |
parent | 6cf149ba99d9dcc8dfe6cbfb47234e22a42e38fa (diff) | |
download | FreeBSD-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.c | 2 |
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) |