fix:prevent bug
authorBoram Park <boram1288.park@samsung.com>
Fri, 12 Apr 2013 01:03:59 +0000 (10:03 +0900)
committerBoram Park <boram1288.park@samsung.com>
Fri, 12 Apr 2013 01:13:50 +0000 (10:13 +0900)
Change-Id: Ifcc0f556325a08ab33701e4732e0d8ba4d110029

module/xdbg_module_evlog.c
packaging/xorg-x11-module-xdbg.spec

index aedfa5b..e2f9c8f 100644 (file)
@@ -221,6 +221,9 @@ static void evtPrintF (int fd, CARD32 msec, evtType type, EvlogClientInfo *evinf
     static CARD32 prev;
     xReq *req = NULL;
 
+    XDBG_RETURN_IF_FAIL (type >= 0 && (sizeof (evt_dir) / sizeof (char*)));
+    XDBG_RETURN_IF_FAIL (type >= 0 && (sizeof (evt_type) / sizeof (char*)));
+
     if(evinfo)
     {
         req = (xReq *)evinfo->requestBuffer;
@@ -850,6 +853,7 @@ xDbgModuleEvlogPrintEvlog (XDbgModule *pMod, int pid, char *evlog_path, char *re
 
         read_len = read (fd, &type, sizeof (evtType));
         XDBG_GOTO_IF_FAIL (read_len == sizeof (evtType), print_done);
+        XDBG_GOTO_IF_FAIL (type >= EVENT && type <= FLUSH, print_done);
         total += read_len;
 
         read_len = read (fd, &mask, sizeof (int));
index 7fe6195..00ac226 100644 (file)
@@ -1,6 +1,6 @@
 Name: xorg-x11-module-xdbg
 Summary: Xserver debug module
-Version: 0.1.8
+Version: 0.1.9
 Release:    1
 Group:      System/Libraries
 License:    MIT