Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/include/linux Fix bounds checking in h...



details:   https://anonhg.NetBSD.org/src/rev/f10f0cc0d356
branches:  trunk
changeset: 333962:f10f0cc0d356
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Nov 24 01:27:07 2014 +0000

description:
Fix bounds checking in hdmi_infoframe_header_pack (PR kern/49411).

diffstat:

 sys/external/bsd/drm2/include/linux/hdmi.h |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r bef879b3074c -r f10f0cc0d356 sys/external/bsd/drm2/include/linux/hdmi.h
--- a/sys/external/bsd/drm2/include/linux/hdmi.h        Sun Nov 23 23:05:19 2014 +0000
+++ b/sys/external/bsd/drm2/include/linux/hdmi.h        Mon Nov 24 01:27:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hdmi.h,v 1.4 2014/11/23 16:16:29 riastradh Exp $       */
+/*     $NetBSD: hdmi.h,v 1.5 2014/11/24 01:27:07 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -197,8 +197,9 @@
 {
        uint8_t *const p = buf;
 
-       if ((size < length) ||
-           (size - length < HDMI_INFOFRAME_HEADER_SIZE))
+       if (length < HDMI_INFOFRAME_HEADER_SIZE)
+               return -ENOSPC;
+       if (size < length)
                return -ENOSPC;
 
        p[0] = header->type;



Home | Main Index | Thread Index | Old Index