Module Name: src
Committed By: riastradh
Date: Mon Nov 24 01:27:07 UTC 2014
Modified Files:
src/sys/external/bsd/drm2/include/linux: hdmi.h
Log Message:
Fix bounds checking in hdmi_infoframe_header_pack (PR kern/49411).
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/hdmi.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/include/linux/hdmi.h
diff -u src/sys/external/bsd/drm2/include/linux/hdmi.h:1.4 src/sys/external/bsd/drm2/include/linux/hdmi.h:1.5
--- src/sys/external/bsd/drm2/include/linux/hdmi.h:1.4 Sun Nov 23 16:16:29 2014
+++ src/sys/external/bsd/drm2/include/linux/hdmi.h Mon Nov 24 01:27:07 2014
@@ -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 @@ hdmi_infoframe_header_pack(const struct
{
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;