Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/n8/common/api PR/50738: David Binderman: Check b...



details:   https://anonhg.NetBSD.org/src/rev/b120b758f9ec
branches:  trunk
changeset: 343396:b120b758f9ec
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 01 17:40:49 2016 +0000

description:
PR/50738: David Binderman: Check bounds before dereferencing.

diffstat:

 sys/dev/pci/n8/common/api/n8_pk_ops.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 894e775587d1 -r b120b758f9ec sys/dev/pci/n8/common/api/n8_pk_ops.c
--- a/sys/dev/pci/n8/common/api/n8_pk_ops.c     Mon Feb 01 17:39:41 2016 +0000
+++ b/sys/dev/pci/n8/common/api/n8_pk_ops.c     Mon Feb 01 17:40:49 2016 +0000
@@ -32,7 +32,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-static char const n8_id[] = "$Id: n8_pk_ops.c,v 1.1 2008/10/30 12:02:14 darran Exp $";
+static char const n8_id[] = "$Id: n8_pk_ops.c,v 1.2 2016/02/01 17:40:49 christos Exp $";
 /*****************************************************************************/
 /** @file n8_pk_ops.c
  *  @brief Implementation of PKP Base Operations
@@ -100,7 +100,7 @@
    out_p->value_p = in_p->value_p;
 
    i = 0;
-   while ((in_p->value_p[i] == 0x0) && (i < in_p->lengthBytes))
+   while (i < in_p->lengthBytes && in_p->value_p[i] == 0x0)
    {
       i++;
    }



Home | Main Index | Thread Index | Old Index