Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-12:GA
rdist
rdist-6.1.5-links.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rdist-6.1.5-links.patch of Package rdist
--- rdist-6.1.5/include/defs.h +++ rdist-6.1.5/include/defs.h @@ -286,9 +286,9 @@ ino_t inum; dev_t devnum; int count; - char pathname[BUFSIZ]; - char src[BUFSIZ]; - char target[BUFSIZ]; + char *pathname; + char *src; + char *target; struct linkbuf *nextp; }; --- rdist-6.1.5/src/client.c +++ rdist-6.1.5/src/client.c @@ -307,6 +307,18 @@ return(0); } +void freelinkinfo(lp) + struct linkbuf *lp; +{ + if (lp->pathname) + free(lp->pathname); + if (lp->src) + free(lp->src); + if (lp->target) + free(lp->target); + free(lp); +} + /* * Save and retrieve hard link info */ @@ -315,6 +327,7 @@ { struct linkbuf *lp; + /* xxx: linear search doesn't scale with many links */ for (lp = ihead; lp != NULL; lp = lp->nextp) if (lp->inum == statp->st_ino && lp->devnum == statp->st_dev) { lp->count--; @@ -327,12 +340,14 @@ lp->inum = statp->st_ino; lp->devnum = statp->st_dev; lp->count = statp->st_nlink - 1; - (void) strcpy(lp->pathname, target); - (void) strcpy(lp->src, source); + lp->pathname = strdup(target); + lp->src = strdup(source); if (Tdest) - (void) strcpy(lp->target, Tdest); + lp->target = strdup(Tdest); else - *lp->target = CNULL; + lp->target = NULL; + if (!lp->pathname || !lp->src || !(Tdest && lp->target)) + fatalerr("Cannot malloc memory in linkinfo."); return((struct linkbuf *) NULL); } --- rdist-6.1.5/src/docmd.c +++ rdist-6.1.5/src/docmd.c @@ -588,7 +588,7 @@ if (!nflag) { struct linkbuf *nextl, *l; - for (l = ihead; l != NULL; free((char *)l), l = nextl) { + for (l = ihead; l != NULL; freelinkinfo(l), l = nextl) { nextl = l->nextp; if (contimedout || IS_ON(opts, DO_IGNLNKS) || l->count == 0)
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