Hi Maks,

On Mon, Jul 01, 2024 at 10:47:05PM +0300, Maks Mishin wrote:
> After having been assigned to a NULL value at 
> dwfl_segment_report_module.c:200,
> pointer 'retval' is dereferenced at dwfl_segment_report_module.c:208 by 
> calling function 'strcmp'.
> 
> Found by RASU JSC.
> [...]
>       return NULL;
>        if (mix == firstix)
>       retval = fptr;
> -      if (firstix < mix && mix <= lastix && strcmp (fptr, retval) != 0)
> +      if (retval != NULL)
> +        if (firstix < mix && mix <= lastix && strcmp (fptr, retval) != 0)
>       return NULL;
>        fptr = fnext + 1;

Indentation is wrong, but this is also unncessary since it cannot
happen. In the loop just above firstix is set to be between zero and
lastix. Then in the line above in this loop over mix from zero to
lastix retval is set when mix == firstix. So when firstix < mix retval
is definitely set.

Cheers,

Mark


Reply via email to