diff options
author | delphij <delphij@FreeBSD.org> | 2009-05-28 00:38:24 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-05-28 00:38:24 +0000 |
commit | 1e64043f43a087e210d5a2447b625d54b100fbfb (patch) | |
tree | 31899b16dcf4762697e530ad4be32ed2bdac72a7 /usr.bin | |
parent | 3d7b880e84dc48c67cf00008f1aa19d467a8db25 (diff) | |
download | FreeBSD-src-1e64043f43a087e210d5a2447b625d54b100fbfb.zip FreeBSD-src-1e64043f43a087e210d5a2447b625d54b100fbfb.tar.gz |
Correct off-by-one issue in truss(1) which happens when system call number
is nsyscalls.
PR: bin/134916
Submitted by: Steven Hartland <steven hartland multiplay co uk>
MFC after: 2 weeks
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/truss/amd64-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/amd64-fbsd32.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/amd64-linux32.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/i386-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/i386-linux.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/ia64-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/mips-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/powerpc-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/sparc64-fbsd.c | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/truss/amd64-fbsd.c b/usr.bin/truss/amd64-fbsd.c index f7c949a..bfd39c2 100644 --- a/usr.bin/truss/amd64-fbsd.c +++ b/usr.bin/truss/amd64-fbsd.c @@ -142,7 +142,7 @@ amd64_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff --git a/usr.bin/truss/amd64-fbsd32.c b/usr.bin/truss/amd64-fbsd32.c index 9b0eb28..eab841c 100644 --- a/usr.bin/truss/amd64-fbsd32.c +++ b/usr.bin/truss/amd64-fbsd32.c @@ -152,7 +152,7 @@ amd64_fbsd32_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : freebsd32_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); diff --git a/usr.bin/truss/amd64-linux32.c b/usr.bin/truss/amd64-linux32.c index 7d88c8d..5e9d012 100644 --- a/usr.bin/truss/amd64-linux32.c +++ b/usr.bin/truss/amd64-linux32.c @@ -124,7 +124,7 @@ amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff --git a/usr.bin/truss/i386-fbsd.c b/usr.bin/truss/i386-fbsd.c index 6f774b2..8500f32 100644 --- a/usr.bin/truss/i386-fbsd.c +++ b/usr.bin/truss/i386-fbsd.c @@ -147,7 +147,7 @@ i386_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff --git a/usr.bin/truss/i386-linux.c b/usr.bin/truss/i386-linux.c index 2bd6e7b..cf4c1c0 100644 --- a/usr.bin/truss/i386-linux.c +++ b/usr.bin/truss/i386-linux.c @@ -124,7 +124,7 @@ i386_linux_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux_syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux_syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff --git a/usr.bin/truss/ia64-fbsd.c b/usr.bin/truss/ia64-fbsd.c index 8c82218..dae1116 100644 --- a/usr.bin/truss/ia64-fbsd.c +++ b/usr.bin/truss/ia64-fbsd.c @@ -135,7 +135,7 @@ ia64_syscall_entry(struct trussinfo *trussinfo, int nargs) { syscall_num = (int)*parm_offset++; fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num > nsyscalls) + fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); diff --git a/usr.bin/truss/mips-fbsd.c b/usr.bin/truss/mips-fbsd.c index 342883c..0ef4ac9 100644 --- a/usr.bin/truss/mips-fbsd.c +++ b/usr.bin/truss/mips-fbsd.c @@ -139,7 +139,7 @@ mips_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff --git a/usr.bin/truss/powerpc-fbsd.c b/usr.bin/truss/powerpc-fbsd.c index 43f7c9e..8de66ee 100644 --- a/usr.bin/truss/powerpc-fbsd.c +++ b/usr.bin/truss/powerpc-fbsd.c @@ -149,7 +149,7 @@ powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } diff --git a/usr.bin/truss/sparc64-fbsd.c b/usr.bin/truss/sparc64-fbsd.c index 7877743..d06e6b0 100644 --- a/usr.bin/truss/sparc64-fbsd.c +++ b/usr.bin/truss/sparc64-fbsd.c @@ -145,7 +145,7 @@ sparc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.number = syscall_num; fsc.name = - (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; if (!fsc.name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } |