mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-02 22:51:25 +00:00
Fix for bug 774. Check malloc return before accessing pointer.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@775 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
cfbd699177
commit
4dd48bef0d
@ -1850,14 +1850,14 @@ saEvtEventPublish(
|
||||
|
||||
req = malloc(sizeof(*req) + eventDataSize + pattern_size);
|
||||
|
||||
patterns = (struct event_pattern *)req->led_body;
|
||||
data_start = (void *)req->led_body + pattern_size;
|
||||
|
||||
if (!req) {
|
||||
error = SA_AIS_ERR_NO_MEMORY;
|
||||
goto pub_put3;
|
||||
}
|
||||
|
||||
patterns = (struct event_pattern *)req->led_body;
|
||||
data_start = (void *)req->led_body + pattern_size;
|
||||
|
||||
/*
|
||||
* copy everything to the request structure
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user