[gnet-dev] glibc detected *** free(): invalid pointer



Hi,

Getting this weird error. I can only figure out that its coming from
part of the code that uses the gnet library.

OS: Fedora Core 3
Kernel: 2.6.9-1.667
Glibc: 2.3.3-74

Code:
=====
int base64(char *pkt)
        {
         gchar* b64;
         gchar* bin;
         gint lens2=0;
         char *ziphdr = "PK";
         char *token = NULL, *delim = ":";
         int i;

         gnet_init();

         b64 = pkt;
         bin = gnet_base64_decode(b64,strlen(b64),&lens2);


         if(lens2 > 0)
                {
	         fprintf(stdout,"%s\n\n%s\n\n%d\n",b64,bin,lens2);

                 token = strtok(line2,delim);

                 while(token != NULL)
                        {
                         fprintf(stdout,"Ext:%s\n\nPacket:
%s\n\n",token,bin);
                         if( (strstr(bin,token) != NULL) &&
(strstr(bin,ziphdr) != NULL) )
                                {
                                 fprintf(stdout, "Binary: %s\n Zipped
Extension found: %s\n",bin,token);
                                 return(1);
                                }
                         token = strtok(NULL,delim);
                         fprintf(stdout,"%s\n",token);
                        }
                }

         return(0);
        }
=================================================================
The function is called with a valid pointer to the payload of a TCP packet.


Debug:
======
(gdb) run inlineav.conf
Starting program: /root/progs/sniff inlineav.conf
[Thread debugging using libthread_db enabled]
[New Thread -151648576 (LWP 11870)]
*** glibc detected *** free(): invalid pointer: 0x09fd6f18 ***

Program received signal SIGABRT, Aborted.
[Switching to Thread -151648576 (LWP 11870)]
0x008837a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
=================================================================

Any help would be appreciated.

- Siddhartha



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]