Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/pnpbios catch zeroed ID string (happens for di...



details:   https://anonhg.NetBSD.org/src/rev/8d57723a7ce4
branches:  trunk
changeset: 480567:8d57723a7ce4
user:      drochner <drochner%NetBSD.org@localhost>
date:      Sun Jan 16 03:30:23 2000 +0000

description:
catch zeroed ID string (happens for disabled devices)

diffstat:

 sys/arch/i386/pnpbios/pnpbios.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 91db0dc86f17 -r 8d57723a7ce4 sys/arch/i386/pnpbios/pnpbios.c
--- a/sys/arch/i386/pnpbios/pnpbios.c   Sun Jan 16 03:13:24 2000 +0000
+++ b/sys/arch/i386/pnpbios/pnpbios.c   Sun Jan 16 03:30:23 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pnpbios.c,v 1.8 2000/01/12 19:24:02 drochner Exp $ */
+/* $NetBSD: pnpbios.c,v 1.9 2000/01/16 03:30:23 drochner Exp $ */
 /*
  * Copyright (c) 1999
  *     Matthias Drochner.  All rights reserved.
@@ -618,6 +618,11 @@
                                for (i = 0; i < len; i++)
                                        idstr[i] = NEXTBYTE(p);
                                idstr[len] = '\0';
+                               if (idstr[0] == '\0') {
+                                       /* disabled device */
+                                       free(idstr, M_DEVBUF);
+                                       break;
+                               }
                                r->longname = idstr;
                                break;
                        case 0x05:  /* 32bit memory descriptor */



Home | Main Index | Thread Index | Old Index