bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] wget_css_fuzzer.c: error: lvalue required as left operand


From: Jeffrey Walton
Subject: Re: [Bug-wget] wget_css_fuzzer.c: error: lvalue required as left operand of assignment
Date: Sat, 9 Mar 2019 23:42:27 -0500

On Sat, Mar 9, 2019 at 10:16 PM Jeffrey Walton <address@hidden> wrote:
>
> Hi Everyone,
>
> I'm working on Solaris 11.3 i86pc. I'm building Wget 1.20.1 from sources.
>
> 'make check' is dying at:
>
> gcc -std=gnu11 -DHAVE_CONFIG_H -I. -I../src  -I../src -I. -I../lib
> -I../lib -DSRCDIR=\"/export/home/jwalton/Build-Scripts/wget-1.20.1/fuzz\"
> -DTEST_RUN -I/usr/local/include -DNDEBUG -D_REENTRANT
> -Wno-unused-parameter -Wno-pedantic -I/usr/local/include
> -I/usr/local/include   -I/usr/local/include   -I/usr/local/include
> -DNDEBUG -g2 -O2 -march=native -fPIC -MT wget_css_fuzzer.o -MD -MP -MF
> .deps/wget_css_fuzzer.Tpo -c -o wget_css_fuzzer.o wget_css_fuzzer.c
> wget_css_fuzzer.c: In function 'LLVMFuzzerTestOneInput':
> wget_css_fuzzer.c:95:9: error: lvalue required as left operand of assignment
>   stderr = fopen("/dev/null", "w");
>          ^
> wget_css_fuzzer.c:106:9: error: lvalue required as left operand of assignment
>   stderr = bak;
>          ^
> gmake[3]: *** [wget_css_fuzzer.o] Error 1
> gmake[3]: Leaving directory
> `/export/home/jwalton/Build-Scripts/wget-1.20.1/fuzz'
> gmake[2]: *** [check-am] Error 2
> gmake[2]: Leaving directory
> `/export/home/jwalton/Build-Scripts/wget-1.20.1/fuzz'
> gmake[1]: *** [check-recursive] Error 1
> gmake[1]: Leaving directory `/export/home/jwalton/Build-Scripts/wget-1.20.1'
> gmake: *** [check] Error 2
> Failed to test Wget
>
> It looks like <stdio.h> is included in wget_css_fuzzer.c
> (https://stackoverflow.com/a/47437649/608639). But I am wondering if
> the "macro" requirement is the thing going sideways.
>
> Any thoughts on a workaround?

<stdio.h> includes <iso/stdio_iso.h> and <iso/stdio_c99.h>.
stdio_iso.h has the following (stdio_c99.h lacks them):

typedef __FILE FILE;
...

#if defined(__STDC__)
extern __FILE   __iob[_NFILE];
#define stdin   (&__iob[0])
#define stdout  (&__iob[1])
#define stderr  (&__iob[2])
#else
extern __FILE   _iob[_NFILE];
#define stdin   (&_iob[0])
#define stdout  (&_iob[1])
#define stderr  (&_iob[2])
#endif  /* __STDC__ */

Then, in stdio_tag.h:

    #define __FILE_TAG      __FILE

And in stdio_impl.h:

#ifdef  _LP64
struct __FILE_TAG {
        long    __pad[16];
};
#else
struct __FILE_TAG       /* needs to be binary-compatible with old versions */
{
#ifdef _STDIO_REVERSE
        unsigned char   *_ptr;  /* next character from/to here in buffer */
        int             _cnt;   /* number of available characters in buffer */
#else
        int             _cnt;   /* number of available characters in buffer */
        unsigned char   *_ptr;  /* next character from/to here in buffer */
#endif
        unsigned char   *_base; /* the buffer */
        ...
};
#endif

I don't really see what the problem is. It looks like a potential lvalue to me.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]