Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
rarian
rarian-0.5.6-reg-parse-bugs.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rarian-0.5.6-reg-parse-bugs.patch of Package rarian
--- rarian-0.6.0/librarian/rarian-reg-utils.c +++ rarian-0.6.0/librarian/rarian-reg-utils.c @@ -89,6 +89,10 @@ } file = fopen (filename, "r"); + if (!file) { + rrn_reg_free (reg); + return NULL; + } buf = malloc (sizeof (char) * 1024); while (fgets (buf, 1023, file)) { @@ -607,13 +614,18 @@ char *tmp; char *result = NULL; tmp = strdup (buf); - buf = fgets (buf, 1023, file); - result = malloc (sizeof (char) * (strlen(tmp)+strlen(buf)+2)); + if (fgets (buf, 1023, file)) { + result = malloc (sizeof (char) * 2048); strcpy (result, tmp); strcat (result, buf); free (tmp); free (buf); - buf = result; + buf = result; + } else { + free (buf); + buf = realloc (tmp, sizeof (char) * 1024); + break; + } } real = buf; while (*real && isspace(*real) && *real != '\n') {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor