Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/sunos replace memcpy() with src bounds overflow w...



details:   https://anonhg.NetBSD.org/src/rev/d931404d4c88
branches:  trunk
changeset: 1003911:d931404d4c88
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Oct 04 12:24:12 2019 +0000

description:
replace memcpy() with src bounds overflow with single char write.

diffstat:

 sys/compat/sunos/sunos_misc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 38a7195930cd -r d931404d4c88 sys/compat/sunos/sunos_misc.c
--- a/sys/compat/sunos/sunos_misc.c     Fri Oct 04 12:23:37 2019 +0000
+++ b/sys/compat/sunos/sunos_misc.c     Fri Oct 04 12:24:12 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $        */
+/*     $NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $     */
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -657,7 +657,7 @@
        memcpy(sut.nodename, hostname, sizeof(sut.nodename));
        sut.nodename[sizeof(sut.nodename)-1] = '\0';
        memcpy(sut.release, osrelease, sizeof(sut.release) - 1);
-       memcpy(sut.version, "1", sizeof(sut.version) - 1);
+       sut.version[0] = '1';
        memcpy(sut.machine, machine, sizeof(sut.machine) - 1);
 
        return copyout((void *)&sut, (void *)SCARG(uap, name),



Home | Main Index | Thread Index | Old Index