Commit e2304db
authored
fix: quiet -Walloc-size-larger-than and -Wformat-truncation warnings (#436)
* fix: quiet -Walloc-size-larger-than and -Wformat-truncation warnings
OPENDMARC_MAX_SHELVES_LG2 was derived from sizeof(size_t) under the
assumption that OPENDMARC_HASH_SHELF is <= 32 bytes, but it actually
holds a pthread_mutex_t and runs 48-72 bytes depending on platform,
so the theoretical max calloc() request could exceed the allocator
limit. The only real caller asks for 8192 buckets, so cap the table
size at a fixed, generous bound instead.
MAXHEADER was sized so that a maxed-out authservid_hdr plus a
maxed-out From-domain could together exceed the malloc'd header
buffer, risking silent truncation of the Authentication-Results
header in pathological cases. Double it so the worst case fits.
* fix: enable subdir-objects to quiet automake forward-incompat warning
test_arcares and test_spf_parse pull source files from
$(top_srcdir)/opendmarc/, which automake warns will become a hard
error in a future release without subdir-objects enabled. Verified
make check still passes (13/13) with objects now placed in a path
mirroring their source tree instead of being flattened.1 parent db07e8f commit e2304db
3 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
214 | 219 | | |
215 | | - | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments