Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8337679

Memset warning in src/hotspot/share/adlc/adlArena.cpp

XMLWordPrintable

    • b18

      Sonarcloud issues the following warning:

      This "memset" is likely to be optimized away by the compiler; either remove it or replace it with "memset_s".
      "memset" should not be used to delete sensitive data.

      Regarding the following chunk of code:
      ```
      void AdlChunk::chop() {
        AdlChunk *k = this;
        while( k ) {
          AdlChunk *tmp = k->_next;
          // clear out this chunk (to detect allocation bugs)
          memset(k, 0xBE, k->_len);
          free(k); // Free chunk (was malloc'd)
          k = tmp;
        }
      }
      ```

            yeren Yagmur Eren
            szaldana Sonia Zaldana Calles
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: