Source-Changes-HG archive

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

[src/trunk]: src/sys * Add a comment to ktrgetheader() mentioning that ktr_le...



details:   https://anonhg.NetBSD.org/src/rev/c0e6fb89f7ef
branches:  trunk
changeset: 471792:c0e6fb89f7ef
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sun Apr 11 18:44:00 1999 +0000

description:
* Add a comment to ktrgetheader() mentioning that ktr_len and ktr_buf are
being left uninitialized intentionally; addresses PR kern/6987.
* In ktrsysret(), initialize the unused ktr_eosys to avoid writing random junk.

diffstat:

 sys/kern/kern_ktrace.c |  4 +++-
 sys/sys/ktrace.h       |  4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 77cd8f93d906 -r c0e6fb89f7ef sys/kern/kern_ktrace.c
--- a/sys/kern/kern_ktrace.c    Sun Apr 11 15:40:58 1999 +0000
+++ b/sys/kern/kern_ktrace.c    Sun Apr 11 18:44:00 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_ktrace.c,v 1.33 1998/09/11 12:50:10 mycroft Exp $ */
+/*     $NetBSD: kern_ktrace.c,v 1.34 1999/04/11 18:44:00 kleink Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
@@ -107,6 +107,7 @@
        microtime(&kth->ktr_time);
        kth->ktr_pid = p->p_pid;
        memcpy(kth->ktr_comm, p->p_comm, MAXCOMLEN);
+       /* Note: ktr_len and ktr_buf are left to be filled in by the caller. */
        return (kth);
 }
 
@@ -154,6 +155,7 @@
        p->p_traceflag |= KTRFAC_ACTIVE;
        kth = ktrgetheader(KTR_SYSRET);
        ktp.ktr_code = code;
+       ktp.ktr_eosys = 0;                      /* XXX unused */
        ktp.ktr_error = error;
        ktp.ktr_retval = retval;                /* what about val2 ? */
 
diff -r 77cd8f93d906 -r c0e6fb89f7ef sys/sys/ktrace.h
--- a/sys/sys/ktrace.h  Sun Apr 11 15:40:58 1999 +0000
+++ b/sys/sys/ktrace.h  Sun Apr 11 18:44:00 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ktrace.h,v 1.16 1998/09/11 12:50:12 mycroft Exp $      */
+/*     $NetBSD: ktrace.h,v 1.17 1999/04/11 18:44:00 kleink Exp $       */
 
 /*
  * Copyright (c) 1988, 1993
@@ -92,7 +92,7 @@
 #define KTR_SYSRET     2
 struct ktr_sysret {
        short   ktr_code;
-       short   ktr_eosys;
+       short   ktr_eosys;              /* XXX unused */
        int     ktr_error;
        int     ktr_retval;
 };



Home | Main Index | Thread Index | Old Index