Commit acdbe25
sdbm.c: fix off-by-one access to global ".dir"
Detected by clang -faddress-sanitizer.
The bug came in 081f72a, where
we started calculating lengths with sizeof on string constants
instead of using strlen. Since string constants include the null
byte, sizeof(".dir"), for example, is 5, but we've been copying 6
bytes.
This patch resolves [perl #111586] and includes revisions by the
committer.1 parent a752ff7 commit acdbe25
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
0 commit comments