-
Bug
-
Resolution: Fixed
-
P4
-
11, 17, 21, 23, 24
-
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;
}
}
```
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;
}
}
```
- links to
-
Commit(master) openjdk/jdk/a7bfced6
-
Review(master) openjdk/jdk/21200