Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1614 Use NonZeroedBuffer for groups in posix_acce…
Browse files Browse the repository at this point in the history
…ss_rights.cpp

Signed-off-by: Marika Lehmann <[email protected]>
  • Loading branch information
FerdinandSpitzschnueffler committed Nov 1, 2022
1 parent 4c8ef81 commit be3a678
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions iceoryx_hoofs/source/posix_wrapper/posix_access_rights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// SPDX-License-Identifier: Apache-2.0

#include "iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp"
#include "iceoryx_hoofs/internal/containers/uninitialized_array.hpp"
#include "iceoryx_hoofs/posix_wrapper/posix_call.hpp"
#include "iceoryx_platform/grp.hpp"
#include "iceoryx_platform/platform_correction.hpp"
Expand Down Expand Up @@ -147,7 +146,7 @@ PosixUser::groupVector_t PosixUser::getGroups() const noexcept
}

gid_t userDefaultGroup = getpwnamCall->value->pw_gid;
containers::UninitializedArray<gid_t, MaxNumberOfGroups, containers::ZeroedBuffer> groups;
containers::UninitializedArray<gid_t, MaxNumberOfGroups> groups{}; // groups is initialized in iox_getgrouplist
int32_t numGroups = MaxNumberOfGroups;

auto getgrouplistCall = posixCall(iox_getgrouplist)(userName->c_str(), userDefaultGroup, &groups[0], &numGroups)
Expand Down

0 comments on commit be3a678

Please sign in to comment.