smart_pkt.c
12.7 KB
-
smart_pkt: adjust style of "ref" packet parsing function · 3fd6ce0d
While the function parsing ref packets doesn't have any immediately obvious buffer overflows, it's style is different to all the other parsing functions. Instead of checking buffer length while we go, it does a check up-front. This causes the code to seem a lot more magical than it really is due to some magic constants. Refactor the function to instead make use of the style of other packet parser and verify buffer lengths as we go. (cherry picked from commit 5edcf5d1)
Patrick Steinhardt committed