diff options
author | Arjun Shankar <arjun@redhat.com> | 2022-08-02 11:10:25 +0200 |
---|---|---|
committer | Arjun Shankar <arjun@redhat.com> | 2022-08-22 16:39:22 +0200 |
commit | cbd8685e82d1b4a7160250845940be68510455ac (patch) | |
tree | bd482ebf6998be9bbea21c1b861cb8bda0224227 /sysdeps/x86/dl-cacheinfo.h | |
parent | 4bafc4001d97ad9501168e091c70f69bd50d9bd9 (diff) | |
download | glibc-cbd8685e82d1b4a7160250845940be68510455ac.tar.gz glibc-cbd8685e82d1b4a7160250845940be68510455ac.tar.xz glibc-cbd8685e82d1b4a7160250845940be68510455ac.zip |
socket: Check lengths before advancing pointer in CMSG_NXTHDR
The inline and library functions that the CMSG_NXTHDR macro may expand to increment the pointer to the header before checking the stride of the increment against available space. Since C only allows incrementing pointers to one past the end of an array, the increment must be done after a length check. This commit fixes that and includes a regression test for CMSG_FIRSTHDR and CMSG_NXTHDR. The Linux, Hurd, and generic headers are all changed. Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x. [BZ #28846] Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
Diffstat (limited to 'sysdeps/x86/dl-cacheinfo.h')
0 files changed, 0 insertions, 0 deletions