mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +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:
parent
bc1adc32cb
commit
749372caf3
@ -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';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user