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()

Backport-of: 6d6c9008d5c87631771e194f475b14e178d16322
  • Loading branch information
MBaesken committed Oct 25, 2023
1 parent bcd73c5 commit e3a2eeb
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

1 comment on commit e3a2eeb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.