diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-12-21 10:14:46 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-12-21 10:14:46 +0100 |
commit | d8aeee11af715507e61464d390f14e4f4fde61b0 (patch) | |
tree | c21ac545e083ff714808a53ab8f39e4e15266a90 /contrib/gcc-changelog/git_commit.py | |
parent | b6237343e78ae115d09618efc1443bdf2fd6c09b (diff) | |
download | gcc-d8aeee11af715507e61464d390f14e4f4fde61b0.zip gcc-d8aeee11af715507e61464d390f14e4f4fde61b0.tar.gz gcc-d8aeee11af715507e61464d390f14e4f4fde61b0.tar.bz2 |
fold-const: Fix up a buffer overflow in native_encode_initializer [PR98407]
For flexible array members we need to incrementally clear just from
ptr + total_bytes up to new ptr + total_bytes, but memset has been called
with the length from ptr, so was missing - total_bytes. Additionally,
in this code off is guaranteed to be -1 and thus o 0, so don't bother pretending
we could handle anything else, it would be more complicated than that.
2020-12-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/98407
* fold-const.c (native_encode_initializer): When handling flexible
array members, fix up computation of length for memset. Also remove
" - o" as o is always guaranteed to be 0 in this code path.
* gcc.c-torture/compile/pr98407.c: New test.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
0 files changed, 0 insertions, 0 deletions