Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1:ARM:Staging
openscap
xinetd_probe.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xinetd_probe.patch of Package openscap
diff --git a/src/OVAL/probes/unix/xinetd_probe.c b/src/OVAL/probes/unix/xinetd_probe.c index 965d8cd04..e911ecc29 100644 --- a/src/OVAL/probes/unix/xinetd_probe.c +++ b/src/OVAL/probes/unix/xinetd_probe.c @@ -1298,6 +1298,7 @@ int op_merge_u16(void *dst, void *src, int type) int op_assign_str(void *var, char *val) { + char *strend = NULL; if (var == NULL) { return -1; } @@ -1306,7 +1307,16 @@ int op_assign_str(void *var, char *val) while(isspace(*val)) ++val; if (*val != '\0') { - *((char **)(var)) = strdup(val); + strend = strrchr(val, '\0'); + /* strip trailing whitespaces */ + do { + strend--; + } while(isspace(*strend)); + if((strend-val) < 0) { + dE("Error stripping white space from string '%s'", val); + return (-1); + } + *((char **)(var)) = strndup(val, (strend-val+1)); return (0); } else return (-1);
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