Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64/amd64 Avoid VLA to appease stack-protector



details:   https://anonhg.NetBSD.org/src/rev/fcc6de162370
branches:  trunk
changeset: 1003517:fcc6de162370
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Sep 18 20:18:27 2019 +0000

description:
Avoid VLA to appease stack-protector

This has been reproduced with -O0 and -fsanitize=undefined.

diffstat:

 sys/arch/amd64/amd64/trap.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 9831f740f05d -r fcc6de162370 sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Wed Sep 18 20:17:46 2019 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Wed Sep 18 20:18:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.123 2019/08/21 17:14:05 maxv Exp $  */
+/*     $NetBSD: trap.c,v 1.124 2019/09/18 20:18:27 kamil Exp $ */
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.123 2019/08/21 17:14:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.124 2019/09/18 20:18:27 kamil Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -351,7 +351,7 @@
        {
                static const char lcall[7] = { 0x9a, 0, 0, 0, 0, 7, 0 };
                const size_t sz = sizeof(lcall);
-               char tmp[sz];
+               char tmp[sizeof(lcall) /* Avoids VLA */];
 
                /* Check for the oosyscall lcall instruction. */
                if (p->p_emul == &emul_netbsd32 &&



Home | Main Index | Thread Index | Old Index