On 2/5/26 7:44 PM, Kevin Traynor wrote:
> Relay arguments have the format 'relay:DB_NAME:<list of remotes>'.
> 
> There is a null terminator check intended to check there are some
> remotes after second colon but it is incorrectly checking the
> index of the second colon itself.
> 
> The second colon is already checked via NULL check on return from
> strchr earlier in the statement.
> 
> Fix null terminator check index to check after the second colon.
> 
> Fixes: 026c77c58ddb ("ovsdb: New ovsdb 'relay' service model.")
> Reported-by: Ilya Maximets <[email protected]>
> Signed-off-by: Kevin Traynor <[email protected]>
> ---
>  ovsdb/ovsdb-server.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
> index 86b0dc7b8..02f641350 100644
> --- a/ovsdb/ovsdb-server.c
> +++ b/ovsdb/ovsdb-server.c
> @@ -429,5 +429,5 @@ parse_relay_args(const char *arg, char **name, char 
> **remote)
>      *remote = strchr(arg + relay_prefix_len, ':');
>  
> -    if (!*remote || (*remote)[0] == '\0') {
> +    if (!*remote || (*remote)[1] == '\0') {
>          *remote = NULL;
>          return false;

It's not worth it to add a unit test for this, it's not an important
check, the database will fail anyway, just at a slightly different
moment. So,

Acked-by: Ilya Maximets <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to