diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-10-06 13:27:10 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-10-06 13:27:10 -0700 |
commit | 3e53a79ea9825172f8a5ccc019af088c5a1e0994 (patch) | |
tree | 90263b1b369c3910f90451d9f5269592d5d672fd /pw-relnotes.5 | |
parent | 8534e9e277723a48cff9f791253a856506e72aa1 (diff) | |
download | pw-3e53a79ea9825172f8a5ccc019af088c5a1e0994.tar.gz pw-3e53a79ea9825172f8a5ccc019af088c5a1e0994.tar.bz2 pw-3e53a79ea9825172f8a5ccc019af088c5a1e0994.zip |
bugfix: memory corruption due to sizeof (dstr)
This was reportd by Jeremy Brubaker along with a working
patch. I reworked it to a shorter fix. Jeremy is using
GCC 13.3.1, Evidently, the sizeof a struct which has a
flexible array member is not the same as the offsetof that
member, which we are relying on. I have to research more into
this because ISO C seems to require them to be the same.
* pw.c (dstr_of, dsgrow): use offsetof (struct dsr, str)
rather than sizeof (dstr) when displacing the string pointer
back to the header, and when allocating the space.
Diffstat (limited to 'pw-relnotes.5')
0 files changed, 0 insertions, 0 deletions