libosmocore[master]: 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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Nov 1 12:35:55 UTC 2017


Patch Set 2:

> IUUC it doesn't only fix the warning, but was also an actual error.
 > vector_slot(V,I) should amount to a void*, right? In the
 > surrounding code, it is used as char*, and the vline vector, IIUC,
 > is a list of string tokens, each terminated by '\0'. So this should
 > actually be a functional change, checking whether the current token
 > is just "\0", in contrast to before, where it checked, in effect,
 > whether the token is NULL. Can we pinpoint a functional change from
 > this patch / could there be fallout?

To be honest I don't know all this VTY code that well, but looking at the code around indeed it seems it handles an array of null terminated string pointers, and the fact that the comparison was made against '\0' and not NULL was giving the hint that the intention here was to check for the string being empty and not for it being NULL (which if I understand should not happen). I submitted the patch hoping people who know better this part of the code could give better verdict.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-HasComments: No



More information about the gerrit-log mailing list