mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix a malloc error path in dmsetup message.
This commit is contained in:
parent
b1ab8b00b8
commit
528329f199
@ -1,5 +1,6 @@
|
||||
Version 1.02.15 -
|
||||
===================================
|
||||
Fix a malloc error path in dmsetup message.
|
||||
More libdevmapper-event interface changes and fixes.
|
||||
Rename dm_saprintf() to dm_asprintf().
|
||||
Report error if NULL pointer is supplied to dm_strdup_aux().
|
||||
|
@ -29,22 +29,11 @@
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <libgen.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include <arpa/inet.h> /* for htonl, ntohl */
|
||||
|
||||
#ifdef linux
|
||||
|
@ -533,7 +533,11 @@ static int _message(int argc, char **argv, void *data __attribute((unused)))
|
||||
for (i = 0; i < argc; i++)
|
||||
sz += strlen(argv[i]) + 1;
|
||||
|
||||
str = dm_malloc(sz);
|
||||
if (!(str = dm_malloc(sz))) {
|
||||
err("message string allocation failed");
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset(str, 0, sz);
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user