Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 145571 Details for
Bug 222637
CVE-2007-0235 Stack overflow libgtop when pathname of mmap()-ed file is too long
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for Gnome bug #396477 libgtop buffer overflow
libgtop2-396477-fix.patch (text/plain), 2.40 KB, created by
Lubomir Kundrak
on 2007-01-15 13:30:19 UTC
(
hide
)
Description:
Patch for Gnome bug #396477 libgtop buffer overflow
Filename:
MIME Type:
Creator:
Lubomir Kundrak
Created:
2007-01-15 13:30:19 UTC
Size:
2.40 KB
patch
obsolete
>Index: sysdeps/linux/procmap.c >=================================================================== >--- sysdeps/linux/procmap.c (révision 2544) >+++ sysdeps/linux/procmap.c (copie de travail) >@@ -38,7 +38,7 @@ > #define SMAPS_FILE "/proc/%u/smaps" > > >-#define PROC_MAPS_FORMAT "%16llx-%16llx %4c %16llx %02hx:%02hx %llu%*[ ]%[^\n]\n" >+#define PROC_MAPS_FORMAT "%16llx-%16llx %4c %16llx %02hx:%02hx %llu%*[ ]%n" > > > static const unsigned long _glibtop_sysdeps_proc_map = >@@ -132,6 +132,8 @@ > FILE *maps; > const char *filename; > gboolean has_smaps; >+ char *line = NULL; >+ size_t line_size = 0; > > glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0); > >@@ -152,33 +154,30 @@ > > while(TRUE) > { >- char line[1024]; >- > unsigned long perm = 0; >- int rv; > guint len; >+ int line_end; > > unsigned short dev_major, dev_minor; > guint64 start, end, offset, inode; > char flags[4]; >- char filename [GLIBTOP_MAP_FILENAME_LEN+1]; >+ char *filename; > > glibtop_map_entry *entry; > >- if (!fgets(line, sizeof line, maps)) >+ if (getline(&line, &line_size, maps) == -1) > break; > > /* 8 arguments */ >- rv = sscanf(line, PROC_MAPS_FORMAT, >- &start, &end, flags, &offset, >- &dev_major, &dev_minor, &inode, filename); >+ if (sscanf(line, PROC_MAPS_FORMAT, >+ &start, &end, flags, &offset, >+ &dev_major, &dev_minor, &inode, &line_end) == EOF) >+ break; > >- if(rv == EOF || rv < 7) >- break; >+ g_assert(line_end < line_size); >+ filename = line + line_end; >+ g_strstrip(filename); > >- if(rv == 7) /* no filename */ >- filename[0] = '\0'; >- > /* Compute access permissions. */ > > if (flags [0] == 'r') >@@ -217,6 +216,7 @@ > > } > >+ free(line); > fclose (maps); > > buf->flags = _glibtop_sysdeps_proc_map; >Index: sysdeps/linux/procopenfiles.c >=================================================================== >--- sysdeps/linux/procopenfiles.c (révision 2544) >+++ sysdeps/linux/procopenfiles.c (copie de travail) >@@ -58,7 +58,8 @@ > parse_file(const char *filename, LineParser parser, GHashTable *dict) > { > FILE *f; >- char line[1024]; >+ char *line = NULL; >+ size_t size = 0; > > f = fopen(filename, "r"); > >@@ -67,15 +68,16 @@ > return; > } > >+ > /* skip the first line */ >- if(!fgets(line, sizeof line, f)) goto eof; >+ if (getline(&line, &size, f) == -1) >+ goto eof; > >- while(fgets(line, sizeof line, f)) >- { >+ while (getline(&line, &size, f) != -1) > parser(dict, line); >- } > > eof: >+ free(line); > fclose(f); > } >
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 222637
: 145571