ra rc.24 segfault with v2 records

VIEAU Cédric 172196 cedric.vieau at cea.fr
Fri Aug 11 05:49:11 EDT 2006


Hi,

ra 3.0-rc.24 generates a segfault with some v2 records:

----------------------------------------
Program received signal SIGSEGV, Segmentation fault.
0xb7e29bcd in bcopy () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7e29bcd in bcopy () from /lib/tls/libc.so.6
#1  0x0807a570 in ArgusConvertRecord (input=0x81c77a8, ptr=0xb7c6d124 "\001\004\210") at argus_util.c:13324
#2  0x0808472e in ArgusReadStreamSocket (parser=0xb7d6c008, input=0x81c77a8) at argus_client.c:300
#3  0x08084a83 in ArgusReadFileStream (parser=0xb7d6c008) at argus_client.c:388
#4  0x0804b20e in main (argc=5, argv=0xbfe3c894) at argus_main.c:161
(gdb) f 1
#1  0x0807a570 in ArgusConvertRecord (input=0x81c77a8, ptr=0xb7c6d124 "\001\004\210") at argus_util.c:13324
13324                              bcopy((char *) &ipattr->hdr, (char *) dsr, sizeof(*dsr));
(gdb) l
13321                           if (ipattr != NULL) {
13322                              unsigned int *dsrptr = (unsigned int *)(dsr + 1);
13323
13324                              bcopy((char *) &ipattr->hdr, (char *) dsr, sizeof(*dsr));
----------------------------------------

Variable ipattr should be initialized with NULL value (it was the case with the "previous rc.24 release"):

----------------------------------------
--- common/argus_util.c.orig    2006-08-11 11:31:02.000000000 +0200
+++ common/argus_util.c 2006-08-11 11:31:45.000000000 +0200
@@ -13173,7 +13173,7 @@
                      case ARGUS_V2_FAR_DSR_STATUS: {
                         struct ArgusV2FarStruct  *far = (struct ArgusV2FarStruct *)hdrs[ARGUS_V2_FAR_DSR_INDEX];
                         struct ArgusTransportStruct *trans = (struct ArgusTransportStruct *) dsr;
-                        struct ArgusIPAttrStruct ipattrbuf, *ipattr;
+                        struct ArgusIPAttrStruct ipattrbuf, *ipattr = NULL;
                         struct ArgusFlow *flow = NULL;
                         struct ArgusTimeObject *dtime = NULL;
                         struct ArgusMetricStruct *metric = NULL;
----------------------------------------

Regards,
Cédric



More information about the argus mailing list