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
3d7b880e84
commit
1e64043f43
@ -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