Skip to content

Commit

Permalink
Merge pull request #59 from dparrish/V1.10.4
Browse files Browse the repository at this point in the history
Fix segfault issue during tab/help processing.
  • Loading branch information
RobSanders authored Mar 10, 2020
2 parents 1d3d6ed + dfe82ee commit 4ef0629
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PREFIX = /usr/local

MAJOR = 1
MINOR = 10
REVISION = 3
REVISION = 4
LIB = libcli.so
LIB_STATIC = libcli.a

Expand Down
7 changes: 6 additions & 1 deletion libcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,13 +933,18 @@ void cli_get_completions(struct cli_def *cli, const char *command, char lastchar
if (c) {
// Advance past first word of stage
i++;
stage->command = c;
stage->first_unmatched = i;
if (c->optargs) {
cli_int_parse_optargs(cli, stage, c, lastchar, comphelp);
} else if (lastchar == '?') {
// Special case for getting help with no defined optargs....
comphelp->num_entries = -1;
}
if (stage->status) {
// if we had an error here we need to redraw the commandline
cli_reprompt(cli);
}
}

cli_int_free_pipeline(pipeline);
Expand Down Expand Up @@ -3310,7 +3315,7 @@ static void cli_int_parse_optargs(struct cli_def *cli, struct cli_pipeline_stage
if (num_candidates > 1 && (lastchar == '\0' || word_idx < (stage->num_words - 1))) {
stage->error_word = stage->words[word_idx];
stage->status = CLI_AMBIGUOUS;
cli_error(cli, "Ambiguous option/argument for command %s", stage->command->command);
cli_error(cli, "\nAmbiguous option/argument for command %s", stage->command->command);
goto done;
}

Expand Down
8 changes: 6 additions & 2 deletions libcli.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version: 1.10.3
Version: 1.10.4
Summary: Cisco-like telnet command-line library
Name: libcli
Release: 1
Expand Down Expand Up @@ -67,7 +67,11 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-, root, root)

%changelog
* Fri Jan 10 2020 Rob Sanders <[email protected]> 10.10.3-1
* Tue Mar 3 2020 Rob Sanders <[email protected]> 1.10.4-1
- Fix segfault issue found during tab/help processing
- Minor fix of version on previous changelog record

* Fri Jan 10 2020 Rob Sanders <[email protected]> 1.10.3-1
- Minor cosmetic change to how help messages are generated, minor edits
to some comments, minor cosmetic change to clitest demo code

Expand Down

0 comments on commit 4ef0629

Please sign in to comment.