[MERGED] libosmocore[master]: Revert "vty: Fix bad use of vector_slot()"

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Nov 1 22:40:58 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: Revert "vty: Fix bad use of vector_slot()"
......................................................................


Revert "vty: Fix bad use of vector_slot()"

The patch seemed sensible, but introduces a segfault when hitting tab
on the interactive VTY. Reproduction example:

  osmo-msc
  telnet 127.0.0.1 4254
  OsmoMSC> enable <TAB>

So we need to understand what that line of code actually intends to do.
Until then, revert this to avoid the segfault.

The segfault happens at:

  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff7bc0894 in cmd_complete_command_real (vline=0x5555558d59e0, vty=0x5555558d57b0, status=0x7fffffffe024) at ../../../../src/libosmocore/src/vty/command.c:1953
  1953                if (*(char *)vector_slot(vline, index) == '\0')

This reverts commit e9e9e427b78271941a25a63567fc2ec2bb9e4433.

Change-Id: I3fe213bdfb96de9469aae64e67000dafee59302e
---
M src/vty/command.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/vty/command.c b/src/vty/command.c
index 355fb5d..21b26b4 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -1950,7 +1950,7 @@
 
 		/* In case of 'command \t' pattern.  Do you need '?' command at
 		   the end of the line. */
-		if (*(char *)vector_slot(vline, index) == '\0')
+		if (vector_slot(vline, index) == '\0')
 			*status = CMD_ERR_NOTHING_TODO;
 		else
 			*status = CMD_ERR_NO_MATCH;

-- 
To view, visit https://gerrit.osmocom.org/4637
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3fe213bdfb96de9469aae64e67000dafee59302e
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list