1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmcmdline: check for NULL

Althought this code likely never is hit with NULL, just add
check to be sure.
This commit is contained in:
Zdenek Kabelac 2024-05-13 14:49:54 +02:00
parent c0e7cdff9d
commit af983ad3d3

View File

@ -1993,7 +1993,7 @@ static void _short_usage(const char *name)
static int _usage(const char *name, int longhelp, int skip_notes)
{
const struct command_name *cname = find_command_name(name);
const struct command_name_args *cna = &command_names_args[cname->lvm_command_enum];
const struct command_name_args *cna = cname ? &command_names_args[cname->lvm_command_enum] : NULL;
struct command *cmd = NULL;
int show_full = longhelp;
int i;