]> granicus.if.org Git - strace/commitdiff
2004-12-20 Dmitry V. Levin <ldv@altlinux.org>
authorRoland McGrath <roland@redhat.com>
Wed, 2 Feb 2005 04:42:25 +0000 (04:42 +0000)
committerRoland McGrath <roland@redhat.com>
Wed, 2 Feb 2005 04:42:25 +0000 (04:42 +0000)
* syscall.c (call_summary): Fix potential NULL dereference.
Fixes RH#143369.

syscall.c

index a02b03cfebd56aadc2d56e6f98cac92c8042a00f..a9f1726326871bfa20f44fff1f1d6894228bb161 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2658,7 +2658,7 @@ FILE *outf;
                error_cum += counts[i].errors;
                tv_add(&tv_cum, &tv_cum, &counts[i].time);
        }
-       if (sortfun)
+       if (counts && sortfun)
                qsort((void *) sorted_count, nsyscalls, sizeof(int), sortfun);
        fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
                "% time", "seconds", "usecs/call",