X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com Content-Type: multipart/mixed; boundary="------------1VPr4LBdWJ46cy2lzULznWOf" Message-ID: <82cd6c37-e6b1-ef67-c35d-cbcd70478aa7@iki.fi> Date: Sat, 14 May 2022 17:07:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-US-large To: djgpp-workers AT delorie DOT com From: "Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via djgpp-workers AT delorie DOT com]" Subject: DJGPP libc and gcc-12.1 analyzer Reply-To: djgpp-workers AT delorie DOT com This is a multi-part message in MIME format. --------------1VPr4LBdWJ46cy2lzULznWOf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Tried to add -fanalyze to C compiler options. Results are in the attachme= nt. I did not try to study=20 in more details for now. Witout -fanalyze I'm getting: make -C ansi/stdio i686-pc-msdosdjgpp-gcc -pipe ... -c allocfil.c i686-pc-msdosdjgpp-gcc -pipe ... -c clearerr.c i686-pc-msdosdjgpp-gcc -pipe ... -c doprnt.c i686-pc-msdosdjgpp-gcc -pipe ... -c doscan.c Funktio =E2=80=9D_instr=E2=80=9D, =C2=A0=C2=A0=C2=A0avattu l=C3=A4hteest=C3=A4 =E2=80=9D_innum=E2=80=9D, d= oscan.c:285:13, =C2=A0=C2=A0=C2=A0avattu l=C3=A4hteest=C3=A4 =E2=80=9D_doscan_low=E2=80=9D= , doscan.c:225:11: doscan.c:542:9:virhe: pointer =E2=80=9Dorig_ptr=E2=80=9D may be used afte= r =E2=80=9Drealloc=E2=80=9D [-Werror=3Duse-after-free] =C2=A0542 | free(orig_ptr); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0| ^~~~~~~~~~~~~~ doscan.c:538:27:huom: call to =E2=80=9Drealloc=E2=80=9D here =C2=A0538 | =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*(char **)arg_ptr =3D re= alloc(orig_ptr, string_length); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: kaikki varoitukset k=C3=A4sitell=C3=A4=C3=A4n virhein=C3=A4 Which seems to be a bug in GCC (false positive as original pointer is sti= ll valid when realloc()=20 fails). I tried to make smaller test example but did not get the same war= ning Andris [andris AT ap src]$ i686-pc-msdosdjgpp-gcc -v Using built-in specs. COLLECT_GCC=3Di686-pc-msdosdjgpp-gcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/i686-pc-msdosdjgpp/12.1.0/lto-wrapper Kohde: i686-pc-msdosdjgpp Configured with: ../gcc-12.1.0/configure --prefix=3D/usr --libexecdir=3D/= usr/lib=20 --target=3Di686-pc-msdosdjgpp --enable-languages=3Dc,c++,fortran,objc,obj= -c++ --enable-shared=20 --enable-static --enable-threads=3Dno --with-system-zlib --with-isl --enable-lto --disable-libgomp --disable-multilib --enable-checking=3Drel= ease --disable-libstdcxx-pch=20 --enable-libstdcxx-filesystem-ts --disable-install-libiberty S=C3=A4iemalli: single Supported LTO compression algorithms: zlib zstd gcc-versio 12.1.0 (GCC) --------------1VPr4LBdWJ46cy2lzULznWOf Content-Type: chemical/x-gulp; name="analyzer.out" Content-Disposition: attachment; filename="analyzer.out" Content-Transfer-Encoding: quoted-printable make -f makefile.cfg sed -f gpp.sed gcc.opt > gpp.opt gcc -O2 -Wall makemake.c -o makemake.exe make -C djasm native bison -o djasm-n.c djasm.y gcc -g -O2 djasm-n.c -o ../../hostbin/djasm.exe ./../misc.exe rm djasm-n.c make -C stub native ./../../hostbin/djasm.exe stub.asm stub.h stub.map 0x5e7 bytes generated, 0x600 bytes in file, 0x870 bytes total, 137 symbol= s gcc -g -O2 stub2inc.c -o stub2inc.exe ./stub2inc.exe stub.map stub.asm ./../../include/stubinfo.h gcc -g -O2 stubedit.c -o ../../hostbin/stubedit.exe gcc -g -O2 stubify.c -o ../../hostbin/stubify.exe make -C utils native make -C dxe native i686-pc-msdosdjgpp-gcc -pipe ... -c init1.S i686-pc-msdosdjgpp-strip --strip-unneeded init1.o ./../../hostbin/bin2h.exe init1.o init1 init1.h i686-pc-msdosdjgpp-gcc -pipe ... -c init2.S i686-pc-msdosdjgpp-strip --strip-unneeded init2.o ./../../hostbin/bin2h.exe init2.o init2 init2.h i686-pc-msdosdjgpp-gcc -pipe ... -c init3.S i686-pc-msdosdjgpp-strip --strip-unneeded init3.o ./../../hostbin/bin2h.exe init3.o init3 init3.h i686-pc-msdosdjgpp-gcc -pipe ... -c init4.S i686-pc-msdosdjgpp-strip --strip-unneeded init4.o ./../../hostbin/bin2h.exe init4.o init4 init4.h i686-pc-msdosdjgpp-gcc -pipe ... -c init5.S i686-pc-msdosdjgpp-strip --strip-unneeded init5.o ./../../hostbin/bin2h.exe init5.o init5 init5.h i686-pc-msdosdjgpp-gcc -pipe ... -c fini1.S i686-pc-msdosdjgpp-strip --strip-unneeded fini1.o ./../../hostbin/bin2h.exe fini1.o fini1 fini1.h i686-pc-msdosdjgpp-gcc -pipe ... -c fini2.S i686-pc-msdosdjgpp-strip --strip-unneeded fini2.o ./../../hostbin/bin2h.exe fini2.o fini2 fini2.h i686-pc-msdosdjgpp-gcc -pipe ... -c fini3.S i686-pc-msdosdjgpp-strip --strip-unneeded fini3.o ./../../hostbin/bin2h.exe fini3.o fini3 fini3.h i686-pc-msdosdjgpp-gcc -pipe ... -c fini4.S i686-pc-msdosdjgpp-strip --strip-unneeded fini4.o ./../../hostbin/bin2h.exe fini4.o fini4 fini4.h i686-pc-msdosdjgpp-gcc -pipe ... -c fini5.S i686-pc-msdosdjgpp-strip --strip-unneeded fini5.o ./../../hostbin/bin2h.exe fini5.o fini5 fini5.h gcc -g -O2 -DDXE_LD=3D\"i686-pc-msdosdjgpp-ld\" -DDXE_CC=3D\"i686-pc-msdo= sdjgpp-gcc\" -DDXE_AR=3D\"i686-pc-msdosdjgpp-ar\" -DDXE_AS=3D\"i686-pc-ms= dosdjgpp-as\" dxe3gen.c -o ../../hostbin/dxegen.exe rm fini2.o fini1.o init5.o fini4.o init3.o init4.o init2.o fini3.o fini5.= o init1.o make -C mkdoc building new response file gcc -g -O2 mkdoc.cc -lstdc++ -o ../../hostbin/mkdoc.exe make -C libc ../makemake.exe makemake: scanning libc for makefiles make -f makefile.sub make -C ansi/assert=20 i686-pc-msdosdjgpp-gcc -pipe ... -c assert.c building new response file make -C ansi/ctype=20 i686-pc-msdosdjgpp-gcc -pipe ... -c ct_flags.c i686-pc-msdosdjgpp-gcc -pipe ... -c ct_lower.c i686-pc-msdosdjgpp-gcc -pipe ... -c ct_upper.c i686-pc-msdosdjgpp-gcc -pipe ... -c isalnum.c i686-pc-msdosdjgpp-gcc -pipe ... -c isalpha.c i686-pc-msdosdjgpp-gcc -pipe ... -c isascii.c i686-pc-msdosdjgpp-gcc -pipe ... -c isblank.c i686-pc-msdosdjgpp-gcc -pipe ... -c iscntrl.c i686-pc-msdosdjgpp-gcc -pipe ... -c isdigit.c i686-pc-msdosdjgpp-gcc -pipe ... -c isgraph.c i686-pc-msdosdjgpp-gcc -pipe ... -c islower.c i686-pc-msdosdjgpp-gcc -pipe ... -c isprint.c i686-pc-msdosdjgpp-gcc -pipe ... -c ispunct.c i686-pc-msdosdjgpp-gcc -pipe ... -c isspace.c i686-pc-msdosdjgpp-gcc -pipe ... -c isupper.c i686-pc-msdosdjgpp-gcc -pipe ... -c isxdigit.c i686-pc-msdosdjgpp-gcc -pipe ... -c toascii.c i686-pc-msdosdjgpp-gcc -pipe ... -c tolower.c i686-pc-msdosdjgpp-gcc -pipe ... -c toupper.c building new response file make -C ansi/errno=20 i686-pc-msdosdjgpp-gcc -pipe ... -c errno.c building new response file make -C ansi/locale=20 i686-pc-msdosdjgpp-gcc -pipe ... -c lconv.c i686-pc-msdosdjgpp-gcc -pipe ... -c mbcurmax.c i686-pc-msdosdjgpp-gcc -pipe ... -c mblen.c i686-pc-msdosdjgpp-gcc -pipe ... -c mbstowcs.c i686-pc-msdosdjgpp-gcc -pipe ... -c mbtowc.c i686-pc-msdosdjgpp-gcc -pipe ... -c setlocal.c i686-pc-msdosdjgpp-gcc -pipe ... -c wcstombs.c i686-pc-msdosdjgpp-gcc -pipe ... -c wctomb.c building new response file make -C ansi/math=20 i686-pc-msdosdjgpp-gcc -pipe ... -c acos.S i686-pc-msdosdjgpp-gcc -pipe ... -c acosh.S i686-pc-msdosdjgpp-gcc -pipe ... -c asin.S i686-pc-msdosdjgpp-gcc -pipe ... -c asinh.S i686-pc-msdosdjgpp-gcc -pipe ... -c atan.S i686-pc-msdosdjgpp-gcc -pipe ... -c atan2.S i686-pc-msdosdjgpp-gcc -pipe ... -c atanh.S i686-pc-msdosdjgpp-gcc -pipe ... -c ceil.S i686-pc-msdosdjgpp-gcc -pipe ... -c cos.S i686-pc-msdosdjgpp-gcc -pipe ... -c cosh.S i686-pc-msdosdjgpp-gcc -pipe ... -c exp.S i686-pc-msdosdjgpp-gcc -pipe ... -c fabs.S i686-pc-msdosdjgpp-gcc -pipe ... -c floor.S i686-pc-msdosdjgpp-gcc -pipe ... -c fmod.S i686-pc-msdosdjgpp-gcc -pipe ... -c frexp.S i686-pc-msdosdjgpp-gcc -pipe ... -c huge_val.c i686-pc-msdosdjgpp-gcc -pipe ... -c hypot.S i686-pc-msdosdjgpp-gcc -pipe ... -c ldexp.S i686-pc-msdosdjgpp-gcc -pipe ... -c log.S i686-pc-msdosdjgpp-gcc -pipe ... -c log10.S i686-pc-msdosdjgpp-gcc -pipe ... -c modf.S i686-pc-msdosdjgpp-gcc -pipe ... -c modfl.S i686-pc-msdosdjgpp-gcc -pipe ... -c pow.S i686-pc-msdosdjgpp-gcc -pipe ... -c pow10.S i686-pc-msdosdjgpp-gcc -pipe ... -c pow2.S i686-pc-msdosdjgpp-gcc -pipe ... -c sin.S i686-pc-msdosdjgpp-gcc -pipe ... -c sinh.S i686-pc-msdosdjgpp-gcc -pipe ... -c sqrt.S i686-pc-msdosdjgpp-gcc -pipe ... -c tan.S i686-pc-msdosdjgpp-gcc -pipe ... -c tanh.S building new response file make -C ansi/setjmp=20 i686-pc-msdosdjgpp-gcc -pipe ... -c longjmp.S i686-pc-msdosdjgpp-gcc -pipe ... -c setjmp.S building new response file make -C ansi/stdio=20 i686-pc-msdosdjgpp-gcc -pipe ... -c allocfil.c i686-pc-msdosdjgpp-gcc -pipe ... -c clearerr.c i686-pc-msdosdjgpp-gcc -pipe ... -c doprnt.c i686-pc-msdosdjgpp-gcc -pipe ... -c doscan.c doscan.c: Funktio =E2=80=9D_instr=E2=80=9D: doscan.c:528:6: virhe: leak of =E2=80=9Dptr=E2=80=9D [CWE-401] [-Werror=3D= analyzer-malloc-leak] 528 | if (matched) | ^ =E2=80=9D_instr=E2=80=9D: events 1-9 | | 448 | if (allocate_char_buffer) | | ^ | | | | | (1) following =E2=80=9Dtrue=E2=80=9D branch (when =E2=80= =9Dallocate_char_buffer !=3D 0=E2=80=9D)... | 449 | { | 450 | if (!len) | | ~ | | | | | (2) ...to here | | (3) following =E2=80=9Dfalse=E2=80=9D branch (when =E2= =80=9Dlen !=3D 0=E2=80=9D)... |...... | 458 | orig_ptr =3D ptr =3D malloc(buffer_size); | | ~~~~~~~~~~~~~~~~~~~ | | | | | (4) ...to here | | (5) allocated here | 459 | if (!ptr) | | ~ | | | | | (6) assuming =E2=80=9Dptr=E2=80=9D is non-NULL | | (7) following =E2=80=9Dfalse=E2=80=9D branch (when = =E2=80=9Dptr=E2=80=9D is non-NULL)... |...... | 468 | if (type =3D=3D 's') | | ~ | | | | | (8) ...to here |...... | 528 | if (matched) | | ~ | | | | | (9) following =E2=80=9Dfalse=E2=80=9D branch (when =E2=80= =9Dmatched =3D=3D 0=E2=80=9D)... | =E2=80=9D_instr=E2=80=9D: event 10 | |cc1: | (10): ...to here | =E2=80=9D_instr=E2=80=9D: event 11 | | 528 | if (matched) | | ^ | | | | | (11) =E2=80=9Dptr=E2=80=9D leaks here; was allocated at= (5) | Funktio =E2=80=9D_instr=E2=80=9D, avattu l=C3=A4hteest=C3=A4 =E2=80=9D_innum=E2=80=9D, doscan.c:285:13, avattu l=C3=A4hteest=C3=A4 =E2=80=9D_doscan_low=E2=80=9D, doscan.c:22= 5:11: doscan.c:542:9: virhe: pointer =E2=80=9Dorig_ptr=E2=80=9D may be used aft= er =E2=80=9Drealloc=E2=80=9D [-Werror=3Duse-after-free] 542 | free(orig_ptr); | ^~~~~~~~~~~~~~ doscan.c:538:27: huom: call to =E2=80=9Drealloc=E2=80=9D here 538 | *(char **)arg_ptr =3D realloc(orig_ptr, string_length); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: kaikki varoitukset k=C3=A4sitell=C3=A4=C3=A4n virhein=C3=A4 make[3]: *** [../../../makefile.inc:90: doscan.o] Virhe 1 i686-pc-msdosdjgpp-gcc -pipe ... -c fclose.c i686-pc-msdosdjgpp-gcc -pipe ... -c feof.c i686-pc-msdosdjgpp-gcc -pipe ... -c ferror.c i686-pc-msdosdjgpp-gcc -pipe ... -c fflush.c i686-pc-msdosdjgpp-gcc -pipe ... -c fgetc.c i686-pc-msdosdjgpp-gcc -pipe ... -c fgetpos.c i686-pc-msdosdjgpp-gcc -pipe ... -c fgets.c i686-pc-msdosdjgpp-gcc -pipe ... -c filbuf.c filbuf.c: Funktio =E2=80=9D_filbuf=E2=80=9D: filbuf.c:66:14: virhe: leak of =E2=80=9D*f._base=E2=80=9D [CWE-401] [-Wer= ror=3Danalyzer-malloc-leak] 66 | f->_base =3D &c; | ~~~~~~~~~^~~~ =E2=80=9D_filbuf=E2=80=9D: events 1-5 | | 39 | if (!(f->_flag & _IOREAD)) | | ^ | | | | | (1) following =E2=80=9Dfalse=E2=80=9D branch... |...... | 45 | if (f->_flag & (_IOSTRG | _IOEOF)) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | | | (2) ...to here | | (3) following =E2=80=9Dfalse=E2=80=9D branch... | 46 | return EOF; | 47 | f->_flag &=3D ~_IOUNGETC; | | ~~ | | | | | (4) ...to here | 48 |=20 | 49 | if (f->_base =3D=3D NULL && !(f->_flag & _IONBF)) | | ~ | | | | | (5) following =E2=80=9Dtrue=E2=80=9D branch... | =E2=80=9D_filbuf=E2=80=9D: events 6-13 | | 51 | size =3D __tb_size; | | ^ | | | | | (6) ...to here | 52 | if ((f->_base =3D malloc(size)) =3D=3D NULL) | | ~ ~~~~~~~~~~~~ | | | | | | | (7) allocated here | | (8) assuming =E2=80=9D*f._base=E2=80=9D is non-NULL | | (9) following =E2=80=9Dfalse=E2=80=9D branch... |...... | 59 | f->_flag |=3D _IOMYBUF; | | ~~ | | | | | (10) ...to here |...... | 65 | if (f->_flag & _IONBF) | | ~ =20 | | | | | (11) following =E2=80=9Dtrue=E2=80=9D branch... | 66 | f->_base =3D &c; | | ~~~~~~~~~~~~~ | | | | | (12) ...to here | | (13) =E2=80=9D*f._base=E2=80=9D leaks here; was= allocated at (7) | cc1: kaikki varoitukset k=C3=A4sitell=C3=A4=C3=A4n virhein=C3=A4 make[3]: *** [../../../makefile.inc:90: filbuf.o] Virhe 1 i686-pc-msdosdjgpp-gcc -pipe ... -c flsbuf.c flsbuf.c: Funktio =E2=80=9D_flsbuf=E2=80=9D: flsbuf.c:132:16: virhe: dereference of NULL =E2=80=9D0=E2=80=9D [CWE-476]= [-Werror=3Danalyzer-null-dereference] 132 | *f->_ptr++ =3D c; | ~~~~~~~~~~~^~~ =E2=80=9D_flsbuf=E2=80=9D: event 1 | | 33 | if (!(f->_flag & _IOWRT)) | | ^ | | | | | (1) following =E2=80=9Dfalse=E2=80=9D branch... | =E2=80=9D_flsbuf=E2=80=9D: events 2-15 | | 40 | if (f->_flag & _IOSTRG) | | ~ ^ | | | | | | | (2) ...to here | | (3) following =E2=80=9Dfalse=E2=80=9D branch... |...... | 44 | if ((base =3D f->_base) =3D=3D NULL && !(f->_flag & _IONBF= )) | | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ | | | | | | | | (4) ...to here (6) ...to here | | (5) following =E2=80=9Dtrue=E2=80=9D branch (when =E2=80= =9Dbase=E2=80=9D is NULL)... |...... | 63 | if (f->_flag & _IOLBF) | | ~ =20 | | | | | (7) following =E2=80=9Dtrue=E2=80=9D branch... |...... | 66 | *f->_ptr++ =3D c; | | ~~~~~~~ =20 | | | | | (8) ...to here |...... | 71 | f->_ptr =3D base; | | ~~~~~~~~~~~~~~ | | | | | (9) =E2=80=9Dbase=E2=80=9D is NULL |...... | 96 | while (rn > 0) | | ~~~~~~=20 | | | | | (10) following =E2=80=9Dfalse=E2=80=9D branch (w= hen =E2=80=9Drn =3D=3D 0=E2=80=9D)... |...... | 129 | if (!(f->_flag & (_IOLBF | _IONBF))) | | ~ ~~~~~~~~ | | | | | | | (11) ...to here | | (12) following =E2=80=9Dtrue=E2=80=9D branch... | 130 | { | 131 | f->_cnt--; | | ~~~~~~~ =20 | | | | | (13) ...to here | 132 | *f->_ptr++ =3D c; | | ~~~~~~~~~~~~~~ | | | | | | | (15) dereference of NULL =E2=80=9D*f._ptr=E2=80= =9D | | (14) =E2=80=9D*f._ptr=E2=80=9D is NULL | cc1: kaikki varoitukset k=C3=A4sitell=C3=A4=C3=A4n virhein=C3=A4 make[3]: *** [../../../makefile.inc:90: flsbuf.o] Virhe 1 i686-pc-msdosdjgpp-gcc -pipe ... -c fopen.c i686-pc-msdosdjgpp-gcc -pipe ... -c fprintf.c i686-pc-msdosdjgpp-gcc -pipe ... -c fputc.c i686-pc-msdosdjgpp-gcc -pipe ... -c fputs.c i686-pc-msdosdjgpp-gcc -pipe ... -c fread.c i686-pc-msdosdjgpp-gcc -pipe ... -c freopen.c i686-pc-msdosdjgpp-gcc -pipe ... -c frlist.c i686-pc-msdosdjgpp-gcc -pipe ... -c fscanf.c i686-pc-msdosdjgpp-gcc -pipe ... -c fseek.c i686-pc-msdosdjgpp-gcc -pipe ... -c fsetpos.c i686-pc-msdosdjgpp-gcc -pipe ... -c ftell.c i686-pc-msdosdjgpp-gcc -pipe ... -c fwalk.c i686-pc-msdosdjgpp-gcc -pipe ... -c fwrite.c i686-pc-msdosdjgpp-gcc -pipe ... -c getc.c i686-pc-msdosdjgpp-gcc -pipe ... -c getchar.c i686-pc-msdosdjgpp-gcc -pipe ... -c gets.c i686-pc-msdosdjgpp-gcc -pipe ... -c getw.c i686-pc-msdosdjgpp-gcc -pipe ... -c perror.c i686-pc-msdosdjgpp-gcc -pipe ... -c printf.c i686-pc-msdosdjgpp-gcc -pipe ... -c putc.c i686-pc-msdosdjgpp-gcc -pipe ... -c putchar.c i686-pc-msdosdjgpp-gcc -pipe ... -c puts.c i686-pc-msdosdjgpp-gcc -pipe ... -c putw.c i686-pc-msdosdjgpp-gcc -pipe ... -c remove.c i686-pc-msdosdjgpp-gcc -pipe ... -c rename.c rename.c: Funktio =E2=80=9Dpush_dir=E2=80=9D: rename.c:138:24: virhe: pointer may be used after =E2=80=9Drealloc=E2=80=9D= [-Werror=3Duse-after-free] 138 | pool_end +=3D temp - dirnames_pool; | ~~~~~^~~~~~~~~~~~~~~ rename.c:132:22: huom: call to =E2=80=9Drealloc=E2=80=9D here 132 | temp =3D (char *)realloc(dirnames_pool, pool_size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rename.c:156:25: virhe: pointer may be used after =E2=80=9Drealloc=E2=80=9D= [-Werror=3Duse-after-free] 156 | stack_top +=3D temp - dirstack; | ^ rename.c:149:29: huom: call to =E2=80=9Drealloc=E2=80=9D here 149 | temp =3D (Stacked_Dir *)realloc(dirstack, | ^~~~~~~~~~~~~~~~~ 150 | stack_size * sizeof(Stacked_D= ir)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~ cc1: kaikki varoitukset k=C3=A4sitell=C3=A4=C3=A4n virhein=C3=A4 make[3]: *** [../../../makefile.inc:90: rename.o] Virhe 1 i686-pc-msdosdjgpp-gcc -pipe ... -c _rename.c _rename.c: Funktio =E2=80=9D_rename=E2=80=9D: _rename.c:123:10: virhe: use of uninitialized value =E2=80=9Dr.x.flags=E2= =80=9D [CWE-457] [-Werror=3Danalyzer-use-of-uninitialized-value] 123 | r.x.flags |=3D 1; /* Always set CF before calling a 0x71NN= function. */ | ~~~^~~~~~ =E2=80=9D_rename=E2=80=9D: events 1-4 | | 23 | __dpmi_regs r; | | ^ | | | | | (1) region created on stack here |...... | 38 | if (use_lfn) | | ~ =20 | | | | | (2) following =E2=80=9Dtrue=E2=80=9D branch (when =E2= =80=9Duse_lfn !=3D 0=E2=80=9D)... | 39 | { | 40 | const char *s1 =3D old + strlen(old), *s2 =3D new = + strlen(new); | | ~~~~~~~~~~~ | | | | | (3) ...to here |...... | 51 | if (strcmp(s1, s2) =3D=3D 0) | | ~=20 | | | | | (4) following =E2=80=9Dfalse=E2=80=9D branch (w= hen the strings are non-equal)... | =E2=80=9D_rename=E2=80=9D: events 5-6 | | 59 | r.x.dx =3D __tb_offset; | | ^ | | | | | (5) ...to here |...... | 63 | if (use_lfn && !identical_but_for_case) | | ~ =20 | | | | | (6) following =E2=80=9Dfalse=E2=80=9D branch... | =E2=80=9D_rename=E2=80=9D: event 7 | |cc1: | (7): ...to here | =E2=80=9D_rename=E2=80=9D: events 8-10 | | 121 | if (use_lfn) | | ^ | | | | | (8) following =E2=80=9Dtrue=E2=80=9D branch (when =E2= =80=9Duse_lfn !=3D 0=E2=80=9D)... | 122 | { | 123 | r.x.flags |=3D 1; /* Always set CF before calling a 0= x71NN function. */ | | ~~~~~~~~~ | | | | | (9) ...to here | | (10) use of uninitialized value =E2=80=9Dr.x.flags=E2= =80=9D here | cc1: kaikki varoitukset k=C3=A4sitell=C3=A4=C3=A4n virhein=C3=A4 make[3]: *** [../../../makefile.inc:90: _rename.o] Virhe 1 i686-pc-msdosdjgpp-gcc -pipe ... -c rewind.c i686-pc-msdosdjgpp-gcc -pipe ... -c scanf.c i686-pc-msdosdjgpp-gcc -pipe ... -c setbuf.c i686-pc-msdosdjgpp-gcc -pipe ... -c setbuffe.c i686-pc-msdosdjgpp-gcc -pipe ... -c setlineb.c i686-pc-msdosdjgpp-gcc -pipe ... -c setvbuf.c i686-pc-msdosdjgpp-gcc -pipe ... -c sprintf.c i686-pc-msdosdjgpp-gcc -pipe ... -c sscanf.c i686-pc-msdosdjgpp-gcc -pipe ... -c stdaux.c i686-pc-msdosdjgpp-gcc -pipe ... -c stderr.c i686-pc-msdosdjgpp-gcc -pipe ... -c stdin.c i686-pc-msdosdjgpp-gcc -pipe ... -c stdiohk.c i686-pc-msdosdjgpp-gcc -pipe ... -c stdout.c i686-pc-msdosdjgpp-gcc -pipe ... -c stdprn.c i686-pc-msdosdjgpp-gcc -pipe ... -c tmpfile.c tmpfile.c: Funktio =E2=80=9Dtmpfile=E2=80=9D: tmpfile.c:44:8: virhe: leak of =E2=80=9Dn_t_r=E2=80=9D [CWE-401] [-Werror= =3Danalyzer-malloc-leak] 44 | if (!__solve_symlinks(temp_name, real_path)) | ^ =E2=80=9Dtmpfile=E2=80=9D: events 1-3 | | 26 | char *n_t_r =3D (char *)malloc(L_tmpnam); | | ^~~~~~~~~~~~~~~~ | | | | | (1) allocated here |...... | 29 | if (!n_t_r) | | ~ =20 | | | | | (2) assuming =E2=80=9Dn_t_r=E2=80=9D is non-NULL | | (3) following =E2=80=9Dfalse=E2=80=9D branch (when =E2=80= =9Dn_t_r=E2=80=9D is non-NULL)... | =E2=80=9Dtmpfile=E2=80=9D: event 4 | |cc1: | (4): ...to here | =E2=80=9Dtmpfile=E2=80=9D: event 5 | | 44 | if (!__solve_symlinks(temp_name, real_path)) | | ^ | | | | | (5) =E2=80=9Dn_t_r=E2=80=9D leaks here; was allocated= at (1) | cc1: kaikki varoitukset k=C3=A4sitell=C3=A4=C3=A4n virhein=C3=A4 make[3]: *** [../../../makefile.inc:90: tmpfile.o] Virhe 1 i686-pc-msdosdjgpp-gcc -pipe ... -c tmpnam.c i686-pc-msdosdjgpp-gcc -pipe ... -c ungetc.c i686-pc-msdosdjgpp-gcc -pipe ... -c vfprintf.c i686-pc-msdosdjgpp-gcc -pipe ... -c vprintf.c i686-pc-msdosdjgpp-gcc -pipe ... -c vsprintf.c i686-pc-msdosdjgpp-gcc -pipe ... -c snprintf.c i686-pc-msdosdjgpp-gcc -pipe ... -c vsnprntf.c make[3]: Kohdetta =E2=80=9Dall=E2=80=9D ei tuotettu uudelleen virheiden v= uoksi. building new response file make[2]: *** [makefile.sub:8: all_subs] Virhe 2 make[1]: *** [../makefile.lib:7: all] Virhe 2 ./../../hostbin/mkdoc.exe . libc2.tex 888 nodes processed makeinfo --no-split libc.tex make: *** [makefile:44: subs] Virhe 2 make: *** No rule to make target '../lib/libg.a', needed by 'all'. make: *** No rule to make target '../lib/libpc.a', needed by 'all'. make: Kohdetta =E2=80=9Dall=E2=80=9D ei tuotettu uudelleen virheiden vuok= si. --------------1VPr4LBdWJ46cy2lzULznWOf--