mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 10:19:04 +00:00
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
This commit is contained in:
parent
ef6b515b69
commit
8123f597e9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298640
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue