Skip to content

Commit

Permalink
8332825: ubsan: guardedMemory.cpp:35:11: runtime error: null pointer …
Browse files Browse the repository at this point in the history
…passed as argument 2, which is declared to never be null

Reviewed-by: clanger, mdoerr
  • Loading branch information
MBaesken committed May 27, 2024
1 parent ed81a47 commit be1d374
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hotspot/share/memory/guardedMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ void* GuardedMemory::wrap_copy(const void* ptr, const size_t len, const void* ta
if (outerp != nullptr) {
GuardedMemory guarded(outerp, len, tag);
void* innerp = guarded.get_user_ptr();
memcpy(innerp, ptr, len);
if (ptr != nullptr) {
memcpy(innerp, ptr, len);
}
return innerp;
}
return nullptr; // OOM
Expand Down

5 comments on commit be1d374

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on be1d374 Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken the backport was successfully created on the branch backport-MBaesken-be1d374b-master in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit be1d374b from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 27 May 2024 and was reviewed by Christoph Langer and Martin Doerr.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-be1d374b-master:backport-MBaesken-be1d374b-master
$ git checkout backport-MBaesken-be1d374b-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-be1d374b-master

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on be1d374 Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MBaesken the backport was successfully created on the branch backport-MBaesken-be1d374b-master in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit be1d374b from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 27 May 2024 and was reviewed by Christoph Langer and Martin Doerr.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-MBaesken-be1d374b-master:backport-MBaesken-be1d374b-master
$ git checkout backport-MBaesken-be1d374b-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-MBaesken-be1d374b-master

Please sign in to comment.