Re: [PATCH] nfsroot: Fix missing check for return value of strsep()

From: Benjamin Coddington
Date: Wed Jun 14 2023 - 11:24:20 EST


On 14 Jun 2023, at 10:30, Chenyuan Mi wrote:

> The strsep() function in root_nfs_parse_options() may return NULL
> if argument 'incoming' is NULL. Since 'incoming' has Null check in
> this function, it is also need to add Null check for return value
> of strsep().

Incoming is checked to be non-NULL *before* sending it to strsep() here.

> Found by our static analysis tool.

The tool must be noticing that it is checked for NULL *after* strsep(),
which wouldn't matter to strsep() at all.

Ben