Skip to content

Commit

Permalink
8038244: (fs) Check return value of malloc in Java_sun_nio_fs_AixNati…
Browse files Browse the repository at this point in the history
…veDispatcher_getmntctl()

Reviewed-by: bpb, vtewari, rriggs
  • Loading branch information
MBaesken committed Oct 12, 2023
1 parent eca6ea4 commit 6d6c900
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/java.base/aix/native/libnio/fs/AixNativeDispatcher.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2019 SAP SE. All rights reserved.
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -105,6 +105,10 @@ Java_sun_nio_fs_AixNativeDispatcher_getmntctl(JNIEnv* env, jclass this)
}
buffer_size *= 8;
buffer = malloc(buffer_size);
if (buffer == NULL) {
throwUnixException(env, errno);
return NULL;
}
must_free_buf = 1;
}
/* Treat zero entries like errors. */
Expand Down

3 comments on commit 6d6c900

@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

@openjdk
Copy link

@openjdk openjdk bot commented on 6d6c900 Oct 19, 2023

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 MBaesken-backport-6d6c9008 in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u: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 6d6c9008 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 12 Oct 2023 and was reviewed by Brian Burkhalter, Vyom Tewari and Roger Riggs.

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:

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

Please sign in to comment.