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 702869 Details for
Bug 915769
coroparse: Read unitialized memory if config file contains service without name
[?]
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]
Proposed patch
2013-02-26-0001-Handle-config-file-with-service-without-name.patch (text/plain), 3.46 KB, created by
Jan Friesse
on 2013-02-26 13:30:44 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jan Friesse
Created:
2013-02-26 13:30:44 UTC
Size:
3.46 KB
patch
obsolete
>From 4c2781f556a41b77d1c1578b14fbd66030563e6e Mon Sep 17 00:00:00 2001 >From: Jan Friesse <jfriesse@redhat.com> >Date: Tue, 26 Feb 2013 14:23:34 +0100 >Subject: [PATCH] Handle config file with service without name > >If part of config file looks like: > >service { > ver: 1 >} > >corosync will read unitialized memory probably resulting in fail. >Solution is to properly check result of object_key_get. > >Signed-off-by: Jan Friesse <jfriesse@redhat.com> >--- > exec/service.c | 33 ++++++++++++++++++++++----------- > 1 files changed, 22 insertions(+), 11 deletions(-) > >diff --git a/exec/service.c b/exec/service.c >index 5bc2a98..03dc881 100644 >--- a/exec/service.c >+++ b/exec/service.c >@@ -407,17 +407,17 @@ static unsigned int service_unlink_and_exit ( > object_find_handle, > &object_service_handle) == 0) { > >- corosync_api->object_key_get (object_service_handle, >+ res = corosync_api->object_key_get (object_service_handle, > "name", > strlen ("name"), > (void *)&found_service_name, > NULL); > >- if (strcmp (service_name, found_service_name) != 0) { >+ if (res != 0 || strcmp (service_name, found_service_name) != 0) { > continue; > } > >- corosync_api->object_key_get (object_service_handle, >+ res = corosync_api->object_key_get (object_service_handle, > "ver", > strlen ("ver"), > (void *)&found_service_ver, >@@ -426,16 +426,17 @@ static unsigned int service_unlink_and_exit ( > /* > * If service found and linked exit it > */ >- if (service_ver != *found_service_ver) { >+ if (res != 0 || service_ver != *found_service_ver) { > continue; > } > >- corosync_api->object_key_get ( >+ res = corosync_api->object_key_get ( > object_service_handle, > "service_id", strlen ("service_id"), > (void *)&service_id, NULL); > >- if(service_id != NULL >+ if(res == 0 >+ && service_id != NULL > && *service_id < SERVICE_HANDLER_MAXIMUM_COUNT > && ais_service[*service_id] != NULL) { > >@@ -460,9 +461,11 @@ static unsigned int service_unlink_and_exit ( > (void *)&found_service_handle, > NULL); > >- lcr_ifact_release (*found_service_handle); >+ if (res == 0) { >+ lcr_ifact_release (*found_service_handle); > >- corosync_api->object_destroy (object_service_handle); >+ corosync_api->object_destroy (object_service_handle); >+ } > } > } > >@@ -485,6 +488,7 @@ unsigned int corosync_service_defaults_link_and_init (struct corosync_api_v1 *co > hdb_handle_t object_find_handle; > hdb_handle_t object_find2_handle; > hdb_handle_t object_runtime_handle; >+ int res; > > corosync_api->object_find_create ( > OBJECT_PARENT_HANDLE, >@@ -517,21 +521,28 @@ unsigned int corosync_service_defaults_link_and_init (struct corosync_api_v1 *co > object_find_handle, > &object_service_handle) == 0) { > >- corosync_api->object_key_get (object_service_handle, >+ res = corosync_api->object_key_get (object_service_handle, > "name", > strlen ("name"), > (void *)&found_service_name, > NULL); > >+ if (res != 0) { >+ log_printf(LOGSYS_LEVEL_ERROR, >+ "Service section defined in config file without name key\n"); >+ >+ return (-1); >+ } >+ > found_service_ver = NULL; > >- corosync_api->object_key_get (object_service_handle, >+ res = corosync_api->object_key_get (object_service_handle, > "ver", > strlen ("ver"), > (void *)&found_service_ver, > NULL); > >- found_service_ver_atoi = (found_service_ver ? atoi (found_service_ver) : 0); >+ found_service_ver_atoi = ((res == 0 && found_service_ver) ? atoi (found_service_ver) : 0); > > corosync_service_link_and_init ( > corosync_api, >-- >1.7.1 >
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 915769
: 702869