Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
pacemaker.8750
pacemaker-libcrmcommon-check-sscanf-result-pars...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker-libcrmcommon-check-sscanf-result-parsing-schema-version.patch of Package pacemaker.8750
commit f56e43b8f243858180104dbc8d386192567a092f Author: Ken Gaillot <kgaillot@redhat.com> Date: Mon Oct 9 16:17:25 2017 -0500 Low: libcrmcommon: check sscanf() result when parsing schema version No effect in practice, but makes static analysis happy Index: pacemaker-1.1.16+20170320.77ea74d/lib/common/schemas.c =================================================================== --- pacemaker-1.1.16+20170320.77ea74d.orig/lib/common/schemas.c +++ pacemaker-1.1.16+20170320.77ea74d/lib/common/schemas.c @@ -167,8 +167,11 @@ schema_sort(const struct dirent **a, con { int a_version[2] = {0, 0}, b_version[2] = {0, 0}; - version_from_filename(a[0]->d_name, a_version); - version_from_filename(b[0]->d_name, b_version); + if (!version_from_filename(a[0]->d_name, a_version) + || !version_from_filename(b[0]->d_name, b_version)) { + // Shouldn't be possible, but makes static analysis happy + return 0; + } for (int i = 0; i < 2; ++i) { if (a_version[i] < b_version[i]) { @@ -269,13 +272,19 @@ crm_schema_init(void) int version[2] = { 0, 0 }; char *transform = NULL; - version_from_filename(namelist[lpc]->d_name, version); + if (!version_from_filename(namelist[lpc]->d_name, version)) { + // Shouldn't be possible, but makes static analysis happy + crm_err("Skipping schema '%s': could not parse version", + namelist[lpc]->d_name); + free(namelist[lpc]); + continue; + } if ((lpc + 1) < max) { int next_version[2] = { 0, 0 }; - version_from_filename(namelist[lpc+1]->d_name, next_version); + if (version_from_filename(namelist[lpc+1]->d_name, next_version) + && (version[0] < next_version[0])) { - if (version[0] < next_version[0]) { struct stat s; char *xslt = NULL;
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