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
This commit is contained in:
parent
c86aead66c
commit
948c1a68c6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=192943
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user