Commit Graph

9 Commits

Author SHA1 Message Date
chantra
2f1ea90356 packDataOpt: fix overflow in packing opt (#966)
An option needs a minimum of 4 bytes that contains OPTION-CODE and OPTION-LENGTH
The code was checkign off + 3 > len(msg) instead of off + 4
2019-05-18 18:23:50 +01:00
Miek Gieben
be5ae6ca7a
Add fuzzing framework (#580)
Add easy way to fuzz this dns library, put fuzz related code in fuzz.go
and have a small Makefile.fuzz to be used:

$ make -f Makefile.fuzz build
$ make -f Makefile.fuzz fuzz

Will build and fuzz the library. Both pack/unpack and NewRR are fuzz
targets, but we could open this up.
2017-11-23 09:34:31 +00:00
Miek Gieben
b1fe149a97 Check for l.err in $INCLUDE
This can throw l.err as well, and a l.length of zero, check for both.
2015-08-08 13:41:46 +01:00
Miek Gieben
3b3e522e22 A some length check to $GENERATE modifiers
Short cut these modifier lengths to 255 max. Which seems a reasonable default.
2015-08-08 13:31:38 +01:00
Miek Gieben
d7ca9f827c And check err here as well. 2015-08-07 16:56:49 +01:00
Miek Gieben
3861fcbbb2 Fix HIP parsing 2015-08-07 16:26:37 +01:00
Miek Gieben
d5324dc6e3 Fuzz the text parser
Check if the values send on the channel are errors, if so return
one. Otherwise continue parsing.
2015-08-07 15:01:11 +02:00
Miek Gieben
69d043f8ab Better fuzzing test and NSAP fix
rr can be nil when parsed, if it, for instance only contains a
comment.

NSAP parsing need some parens to make the if-then logic work.
2015-08-07 12:17:16 +02:00
Miek Gieben
1e6d260018 Fuzz NewRR
Add checks for token length == 0.
2015-08-07 10:39:21 +01:00