Date: Fri, 29 Apr 2016 03:12:14 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298766 - stable/10/bin/ed Message-ID: <201604290312.u3T3CEF4094412@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Fri Apr 29 03:12:14 2016 New Revision: 298766 URL: https://svnweb.freebsd.org/changeset/base/298766 Log: MFC r298640: ed(1): switch two statements so we check the index before dereferencing. Modified: stable/10/bin/ed/cbc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ed/cbc.c ============================================================================== --- stable/10/bin/ed/cbc.c Fri Apr 29 03:06:42 2016 (r298765) +++ stable/10/bin/ed/cbc.c Fri Apr 29 03:12:14 2016 (r298766) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604290312.u3T3CEF4094412>