From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19065 invoked by alias); 13 Feb 2012 11:18:47 -0000 Received: (qmail 19045 invoked by uid 9737); 13 Feb 2012 11:18:47 -0000 Date: Mon, 13 Feb 2012 11:18:00 -0000 Message-ID: <20120213111847.19043.qmail@sourceware.org> From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 daemons/dmeventd/dmeventd.c ./WHATS_NEW_DM Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00077.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-02-13 11:18:46 Modified files: daemons/dmeventd: dmeventd.c . : WHATS_NEW_DM Log message: Check for allocation failure Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.c.diff?cvsroot=lvm2&r1=1.88&r2=1.89 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.553&r2=1.554 --- LVM2/daemons/dmeventd/dmeventd.c 2012/02/10 13:46:23 1.88 +++ LVM2/daemons/dmeventd/dmeventd.c 2012/02/13 11:18:45 1.89 @@ -1782,9 +1782,16 @@ } } - _initial_registrations = dm_malloc(sizeof(char*) * (count + 1)); + if (!(_initial_registrations = dm_malloc(sizeof(char*) * (count + 1)))) { + fprintf(stderr, "Memory allocation registration failed.\n"); + exit(EXIT_FAILURE); + } + for (i = 0; i < count; ++i) { - _initial_registrations[i] = dm_strdup(message); + if (!(_initial_registrations[i] = dm_strdup(message))) { + fprintf(stderr, "Memory allocation for message failed.\n"); + exit(EXIT_FAILURE); + } message += strlen(message) + 1; } _initial_registrations[count] = 0; --- LVM2/WHATS_NEW_DM 2012/02/13 11:13:44 1.553 +++ LVM2/WHATS_NEW_DM 2012/02/13 11:18:46 1.554 @@ -1,5 +1,6 @@ Version 1.02.71 - ==================================== + Check for allocation failure in dmeventd restart(). Add few missing allocation failures tests in dmsetup. Fix potential risk of writing in front of buffer in _sysfs_get_dm_name().