Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dtv sections can't be > 4KB



details:   https://anonhg.NetBSD.org/src/rev/3bb120ed8b51
branches:  trunk
changeset: 767269:3bb120ed8b51
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Jul 14 01:37:09 2011 +0000

description:
sections can't be > 4KB

diffstat:

 sys/dev/dtv/dtv_demux.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 830cf95e43a9 -r 3bb120ed8b51 sys/dev/dtv/dtv_demux.c
--- a/sys/dev/dtv/dtv_demux.c   Wed Jul 13 23:48:29 2011 +0000
+++ b/sys/dev/dtv/dtv_demux.c   Thu Jul 14 01:37:09 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtv_demux.c,v 1.2 2011/07/13 22:50:24 jmcneill Exp $ */
+/* $NetBSD: dtv_demux.c,v 1.3 2011/07/14 01:37:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtv_demux.c,v 1.2 2011/07/13 22:50:24 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtv_demux.c,v 1.3 2011/07/14 01:37:09 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -469,6 +469,13 @@
                }
 
                sec->sec_length = section_length + 3;
+
+               /* maximum section length is 4KB */
+               if (sec->sec_length > sizeof(sec->sec_buf)) {
+                       sec->sec_bytesused = sec->sec_length = 0;
+                       goto done;
+               }
+
        }
 
        /* If we have bytes pending and we see payload unit start, flush buf */



Home | Main Index | Thread Index | Old Index