1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

command: use bigger buffer

Instead of use 'silently' shortened passed string - always
make sure we take either a full copy or return error.
This commit is contained in:
Zdenek Kabelac 2018-02-28 16:57:53 +01:00
parent bc1adc32cb
commit 749372caf3

View File

@ -334,13 +334,15 @@ static char *_split_line(char *buf, int *argc, char **argv, char sep)
static int _val_str_to_num(char *str)
{
char name[32];
char name[MAX_LINE_ARGC];
char *new;
int i;
/* compare the name before any suffix like _new or _<lvtype> */
dm_strncpy(name, str, sizeof(name));
if (!dm_strncpy(name, str, sizeof(name)))
return 0; /* Buffer is too short */
if ((new = strchr(name, '_')))
*new = '\0';