lvm2/SOURCES/lvm2-2_03_06-cov-ensure-cname-exists-before-derefering-it.patch

35 lines
1.1 KiB
Diff
Raw Normal View History

2019-11-06 16:35:32 +00:00
tools/command.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 724040e..2e69eff 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -1935,7 +1935,7 @@ void print_usage(struct command *cmd, int longhelp, int desc_first)
* see print_common_options_cmd()
*/
- if ((cname->variants > 1) && cname->common_options[opt_enum])
+ if (cname && (cname->variants > 1) && cname->common_options[opt_enum])
continue;
printf("\n\t[");
@@ -1975,7 +1975,7 @@ void print_usage(struct command *cmd, int longhelp, int desc_first)
* see print_common_options_cmd()
*/
- if ((cname->variants > 1) && cname->common_options[opt_enum])
+ if (cname && (cname->variants > 1) && cname->common_options[opt_enum])
continue;
printf("\n\t[");
@@ -3438,7 +3438,7 @@ static int _print_man(char *name, char *des_file, int secondary)
if (!prev_cmd || strcmp(prev_cmd->name, cmd->name)) {
printf(".SH NAME\n");
- if (cname->desc)
+ if (cname && cname->desc)
printf("%s - %s\n", lvmname, cname->desc);
else
printf("%s\n", lvmname);