[PATCH 3/4] app/testpmd: check for no arguments

fengchengwen fengchengwen at huawei.com
Sat Mar 14 08:57:11 CET 2026


On 3/13/2026 5:24 PM, Kevin Traynor wrote:
> On 3/12/26 11:59 PM, fengchengwen wrote:
>> On 3/13/2026 1:03 AM, Stephen Hemminger wrote:
>>> On Thu, 12 Mar 2026 20:37:42 +0800
>>> fengchengwen <fengchengwen at huawei.com> wrote:
>>>
>>>> Hi Kevin,
>>>>
>>>> On 3/12/2026 6:36 PM, Kevin Traynor wrote:
>>>>> For the case where token is NULL, there are no arguments
>>>>> and split_str[0] is used uninitialized.  
>>>>
>>>> In which case the token is NULL, if there are no arguments, the cmdline's
>>>> callback won't be invoke.
>>>>
>>>> Thanks
>>>
>>> It still maybe possible to get there with an empty string ""
>>> which would evaluate to no arguments?
>>
>> No, as tested below:
>>
>> testpmd> port config  dcb vt on 4 pfc ""
>> Bad arguments
>> testpmd> port config  dcb vt on 4 pfc ''
>> Bad arguments
>> testpmd> port config  dcb vt on 4 pfc '
>> Bad arguments
>> testpmd> port config  dcb vt on 4 pfc
>> Bad arguments
>>
>>
> 
> Ok, no problem to drop the patch if not needed. static analysis was just
> looking at the function as an independent unit.

May I ask what this static analysis tool is?

> 
> 



More information about the dev mailing list