Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266167 Clean up GCC 11 warnings
  3. JDK-8266171

-Warray-bounds happens in imageioJPEG.c

    XMLWordPrintable

    Details

      Backports

        Description

        /home/ysuenaga/git-forked/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c: In function 'Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter':
        /home/ysuenaga/git-forked/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c:673:23: warning: array subscript 'struct jpeg_decompress_struct[0]' is partly outside array bounds of 'unsigned char[520]' [-Warray-bounds]
          673 | free(dinfo->src);
              | ~~~~~^~~~~
        /home/ysuenaga/git-forked/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c:2538:9: note: referencing an object of size 520 allocated by 'malloc'
         2538 | malloc(sizeof(struct jpeg_compress_struct));
              | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /home/ysuenaga/git-forked/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c:674:24: warning: array subscript 'struct jpeg_decompress_struct[0]' is partly outside array bounds of 'unsigned char[520]' [-Warray-bounds]
          674 | dinfo->src = NULL;
              | ^
        /home/ysuenaga/git-forked/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c:2538:9: note: referencing an object of size 520 allocated by 'malloc'
         2538 | malloc(sizeof(struct jpeg_compress_struct));
              | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ysuenaga Yasumasa Suenaga
                Reporter:
                ysuenaga Yasumasa Suenaga
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: