Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 18322 Details for
Bug 29592
Corrections for net-analyzer/geotrace-0.0.4.ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
geotrace-malloc-netgeo.patch (text/plain), 3.47 KB, created by
Olivier Castan
on 2003-09-25 10:05:47 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Olivier Castan
Created:
2003-09-25 10:05:47 UTC
Size:
3.47 KB
patch
obsolete
>diff -urN geotrace-0.0.4/callbacks.c geotrace-0.0.4.new/callbacks.c >--- geotrace-0.0.4/callbacks.c 2001-04-18 16:50:07.000000000 +0200 >+++ geotrace-0.0.4.new/callbacks.c 2003-09-25 17:21:37.000000000 +0200 >@@ -219,19 +219,24 @@ > void add_trace_to_list (char *ret_string) { > struct trace_node *new_node; > int hop; >- char *ip,*name; >+ char *ipbuffer,*ip,*name; > float rtt; > > if (debug_mode) > fprintf (stdout,"(callbacks.c) add_trace_to_list\n"); > new_node = malloc (sizeof(struct trace_node)); >- ip = malloc (18); >- name = malloc (40); >+ ipbuffer = malloc (18); >+ ip = ipbuffer; >+ ip[0] = 0; >+ name = malloc (60); >+ name[0] = 0; > if (strchr(ret_string,'*') == NULL) { > if (resolve) >- sscanf (ret_string,"%d %s %s %f",&hop,name,ip,&rtt); >+ sscanf (ret_string,"%d %59s %17s %f",&hop,name,ip,&rtt); > else >- sscanf (ret_string,"%d %s %f",&hop,ip,&rtt); >+ sscanf (ret_string,"%d %17s %f",&hop,ip,&rtt); >+ ip[17] = 0; >+ name[59] = 0; > new_node->timed_out = 0; > new_node->ip = malloc (strlen(ip)+1); > sprintf (new_node->ip,"%s",strtok(ip,"()")); >@@ -253,7 +258,7 @@ > gdk_threads_enter(); > trace_linked_list = g_list_append (trace_linked_list,new_node); > gdk_threads_leave(); >- free (ip); >+ free (ipbuffer); > free (name); > } > >diff -urN geotrace-0.0.4/map.c geotrace-0.0.4.new/map.c >--- geotrace-0.0.4/map.c 2001-04-15 18:05:37.000000000 +0200 >+++ geotrace-0.0.4.new/map.c 2003-09-25 13:49:17.000000000 +0200 >@@ -45,11 +45,12 @@ > > void scan_maps_file () { > FILE *map_props_file; >- char *tmpstr,*tmpstr2,*tmppath; >+ char *stralloc, *tmpstr,*tmpstr2,*tmppath; > > map_strings = NULL; > host_strings = NULL; >- tmpstr = malloc (512); >+ stralloc = malloc (512); >+ tmpstr = stralloc; > tmppath = malloc (strlen(maps_dir_path)+strlen(MAP_FILE)+1); > sprintf (tmppath,"%s%s",maps_dir_path,MAP_FILE); > map_props_file = fopen(tmppath,"r"); >@@ -69,7 +70,7 @@ > } > } > fclose (map_props_file); >- free (tmpstr); >+ free (stralloc); > free (tmppath); > } > >diff -urN geotrace-0.0.4/netgeoclient.c geotrace-0.0.4.new/netgeoclient.c >--- geotrace-0.0.4/netgeoclient.c 2001-04-11 16:39:11.000000000 +0200 >+++ geotrace-0.0.4.new/netgeoclient.c 2003-09-25 18:36:04.000000000 +0200 >@@ -10,11 +10,11 @@ > > if (debug_mode) > fprintf (stdout,"(netgeoclient.c) get_netgeo_info\n"); >- buffer = malloc (strlen(GEO_STRING)+strlen(request)+2); >- memset(buffer,0,strlen(GEO_STRING)+strlen(request)+2); >+ buffer = malloc (strlen(GEO_STRING)+strlen(request)+strlen(HTTP_STRING)+1); >+ memset(buffer,0,strlen(GEO_STRING)+strlen(request)+strlen(HTTP_STRING)+1); > strcat (buffer,GEO_STRING); > strcat (buffer,request); >- strcat (buffer,"\n"); >+ strcat (buffer,HTTP_STRING); > outfile = fopen (tmpgeofile,"w"); > > send_socket = socket(PF_INET,SOCK_STREAM,0); >@@ -50,8 +50,9 @@ > parse_node = malloc (sizeof(struct netgeo_format)); > infile = fopen (tmpgeofile,"r"); > fscanf(infile,"%[^\n]\n",tmpstr); >- while (strchr(tmpstr,':')==NULL) >+ while (strstr(tmpstr,"<p>")==NULL) > fscanf(infile,"%[^\n]\n",tmpstr); >+ fscanf(infile,"%[^\n]\n",tmpstr); > while (!feof(infile)) { > if (strchr(tmpstr,':')!= NULL) { > tmpstr2 = strtok (tmpstr,":"); >diff -urN geotrace-0.0.4/netgeoclient.h geotrace-0.0.4.new/netgeoclient.h >--- geotrace-0.0.4/netgeoclient.h 2001-03-31 18:14:27.000000000 +0200 >+++ geotrace-0.0.4.new/netgeoclient.h 2003-09-25 18:04:45.000000000 +0200 >@@ -1,4 +1,5 @@ > #define GEO_STRING "GET /perl/netgeo.cgi?target=" >+#define HTTP_STRING " HTTP/1.0\r\n\r\n" > struct netgeo_format { > char *target; > char *city;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 29592
: 18322