Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/acpitools/acpidump Fix theoretical buffer overflow ...



details:   https://anonhg.NetBSD.org/src/rev/6d998b73a518
branches:  trunk
changeset: 759893:6d998b73a518
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sun Dec 19 16:25:16 2010 +0000

description:
Fix theoretical buffer overflow by using MAXPATHLEN for realpath(3).

diffstat:

 usr.sbin/acpitools/acpidump/acpi.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r cc67ee58ceab -r 6d998b73a518 usr.sbin/acpitools/acpidump/acpi.c
--- a/usr.sbin/acpitools/acpidump/acpi.c        Sun Dec 19 15:58:14 2010 +0000
+++ b/usr.sbin/acpitools/acpidump/acpi.c        Sun Dec 19 16:25:16 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.5 2009/12/22 08:44:03 cegger Exp $ */
+/* $NetBSD: acpi.c,v 1.6 2010/12/19 16:25:16 jruoho Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: acpi.c,v 1.5 2009/12/22 08:44:03 cegger Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.6 2010/12/19 16:25:16 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -2335,7 +2335,7 @@
 void
 aml_disassemble(ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdp)
 {
-       char buf[PATH_MAX], tmpstr[PATH_MAX];
+       char buf[MAXPATHLEN], tmpstr[MAXPATHLEN];
        const char *tmpdir;
        char *tmpext;
        FILE *fp;



Home | Main Index | Thread Index | Old Index