Commit 6da8018
committed
fix: assertion failure when fuzzing proto strings
When parsing protobuf messages from libfuzzer bytes in the protobuf
mutator we don't enforce length limits. This could lead to
maxSizeIncrease < 0 situations if the e.g. a String read by the protobuf
mutator exceeds the size limit.
To guard against similar cases we now enforce the size constraints for
the byte array that is being mutated before performing the mutation.1 parent da56919 commit 6da8018
File tree
4 files changed
+24
-12
lines changed- selffuzz/src/test/java/com/code_intelligence/selffuzz/mutation
- src
- main/java/com/code_intelligence/jazzer/mutation/mutator/libfuzzer
- test/java/com/code_intelligence/jazzer/mutation/mutator/lang
4 files changed
+24
-12
lines changedLines changed: 6 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
| 209 | + | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
216 | | - | |
217 | | - | |
| 215 | + | |
218 | 216 | | |
219 | 217 | | |
220 | 218 | | |
| |||
224 | 222 | | |
225 | 223 | | |
226 | 224 | | |
227 | | - | |
228 | | - | |
| 225 | + | |
229 | 226 | | |
230 | 227 | | |
231 | 228 | | |
232 | 229 | | |
233 | 230 | | |
234 | | - | |
235 | | - | |
| 231 | + | |
236 | 232 | | |
237 | 233 | | |
238 | 234 | | |
239 | 235 | | |
240 | 236 | | |
241 | 237 | | |
242 | 238 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 239 | + | |
| 240 | + | |
246 | 241 | | |
247 | 242 | | |
248 | 243 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
src/main/java/com/code_intelligence/jazzer/mutation/mutator/libfuzzer/LibFuzzerMutatorFactory.java
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
229 | 243 | | |
230 | 244 | | |
231 | 245 | | |
| |||
0 commit comments