Coverity Scan: Analysis completed for RTEMS-Newlib

Corinna Vinschen vinschen@redhat.com
Mon Nov 13 13:19:11 GMT 2023


On Nov 10 11:44, Joel Sherrill wrote:
> On Fri, Nov 10, 2023 at 9:32 AM Corinna Vinschen <vinschen@redhat.com>
> wrote:
> 
> > On Nov 10 08:50, Joel Sherrill wrote:
> > > Hmmmm.. an email just before the one I forwarded shows 6 new defects were
> > > added in the last commits. They appear to be the same issue I just
> > > forwarded but in different scanf variants.
> > >
> > > CID 423229 (#1 of 1): Uninitialized scalar variable (UNINIT)2.
> > > uninit_use_in_call: Using uninitialized value f._flags2 when calling
> > > __ssvfiscanf_r. [show details
> > > <
> > https://scan3.scan.coverity.com/eventId=13202494-1&modelId=13202494-0&fileInstanceId=104130545&filePath=%2Fhome%2Fjoel%2Frtems-cron-coverity%2Fsourceware-mirror-newlib-cygwin%2Fnewlib%2Flibc%2Fstdio%2Fvfscanf.c&fileStart=400&fileEnd=1980
> > >
> > > ]
> >
> > Looks like a false positive.
> >
> > The ORIENT macro will set or reset the value of the _flags2 __SWID bit
> > if the _flags __SORD bit isn't set.  It never is set at the start, so
> > the _flags2 __SWID bit is always set.  And only then, the ORIENT macro
> > will check the value.
> >
> 
> Thanks. I will mark them as false positive.
> 
> What about the issue in the printf variants? Looks like similar code. Are
> they
> also false positives? This is from asiprintf.c
> 
> 37  f._flags = __SWR | __SSTR | __SMBF;
> 
> 1. assign_zero: Assigning: f._p = NULL.
> 38  f._bf._base = f._p = NULL;
> 39  f._bf._size = f._w = 0;
> 40  f._file = -1;  /* No file. */
> 41  va_start (ap, fmt);
> 
> CID 387497 (#2 of 2): Explicit null dereferenced (FORWARD_NULL)2.
> var_deref_model: Passing &f to _svfiprintf_r, which dereferences null f._p.
>  [show details
> <https://scan3.scan.coverity.com/eventId=13202490-1&modelId=13202490-0&fileInstanceId=104130544&filePath=%2Fhome%2Fjoel%2Frtems-cron-coverity%2Fsourceware-mirror-newlib-cygwin%2Fnewlib%2Flibc%2Fstdio%2Fvfprintf.c&fileStart=650&fileEnd=1786>
> ]
> 42  ret = _svfiprintf_r (ptr, &f, fmt, ap);

Did you try to debug it?


Corinna



More information about the Newlib mailing list