From b859bea10a0945681ecc66a1aa06ae4cc5845af8 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Sun, 18 Apr 1999 22:50:50 +0000 Subject: [PATCH] Change number of personalities for Linux sparc to 2 Minor other fixes --- NEWS | 4 ++-- defs.h | 8 ++++++-- file.c | 2 +- syscall.c | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index e36b7720..ac8a3fef 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ -Changes in 4.0 -============== +Changes in 3.99 +=============== * New maintainer * add support for more Linux architectures (powerpc, sparc, arm) * support lots more Linux syscalls diff --git a/defs.h b/defs.h index 4dcef209..b7a1d182 100644 --- a/defs.h +++ b/defs.h @@ -29,6 +29,10 @@ * $Id$ */ +#ifdef linux +#include +#endif + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -104,7 +108,7 @@ extern int ptrace(); #endif /* !SVR4 */ #ifdef LINUX -#if !defined(LINUXSPARC) || !defined(__GLIBC__) +#if !defined(__GLIBC__) #define PTRACE_PEEKUSER PTRACE_PEEKUSR #define PTRACE_POKEUSER PTRACE_POKEUSR #endif @@ -124,7 +128,7 @@ extern int ptrace(); #include #include #undef SUPPORTED_PERSONALITIES -#define SUPPORTED_PERSONALITIES 3 +#define SUPPORTED_PERSONALITIES 2 #endif /* LINUXSPARC */ /* Trace Control Block */ diff --git a/file.c b/file.c index 458cb1af..9040ebfe 100644 --- a/file.c +++ b/file.c @@ -457,7 +457,7 @@ int addr; else tprintf("...}"); } -#endif +#endif /* LINUXSPARC */ static void realprintstat(tcp, statbuf) diff --git a/syscall.c b/syscall.c index 70e516ea..045ad278 100644 --- a/syscall.c +++ b/syscall.c @@ -1038,6 +1038,9 @@ struct tcb *tcp; int i; tcp->u_nargs = sysent[tcp->scno].nargs; for (i = 0; i < tcp->u_nargs; i++) { + /* WTA: if scno is out-of-bounds this will bomb. Add range-check + * for scno somewhere above here! + */ if (upeek(pid, REG_A0+i, &tcp->u_arg[i]) < 0) return -1; } -- 2.40.0