Hi,

This patch avoids segfault when there are holes in system call table.
It can happen with syscall (number, ...) and number is in those holes.


H.J.
---
2012-02-03  H.J. Lu  <[email protected]>

        * defs.h (SCNO_IN_RANGE): Also check the sys_func field.

diff --git a/defs.h b/defs.h
index 8bcd34e..2f08511 100644
--- a/defs.h
+++ b/defs.h
@@ -780,7 +780,8 @@ extern unsigned nioctlents;
 extern const char *const *signalent;
 extern unsigned nsignals;
 
-#define SCNO_IN_RANGE(scno) ((unsigned long)(scno) < nsyscalls)
+#define SCNO_IN_RANGE(scno) \
+  ((unsigned long)(scno) < nsyscalls && sysent[scno].sys_func)
 
 #if HAVE_LONG_LONG
 
-- 
1.7.6.5


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to