Ship It!
Generally looks good to me. I'd prefer to change those %d's to %u's, and I would have preferred the use of strnlen() if available (I think we do have it), but I leave the decision here up to you -- feel free to list me as a reviewer either way.
-
usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_tftp.c (Diff revision 1) -
The %d in this should %u. These are unsigned values. Having said that, the uint16_t is losslessly convertible to int, so it's ok, but %u would be more pedantically correct.
-
usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_tftp.c (Diff revision 1) -
Instead of all this logic to constrain the length by stuffing a \0 at the end of tftp_options, why not just use strnlen() to ensure that we don't walk past the end?
Also, the way this works it means that the options is constrained to 127 bytes (128 with \0)... is that intended?
-
usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_tftp.c (Diff revision 1) -
A comment here indicating that the spec requires that the options be treated case insensitively would be helpful. (I just checked the RFC.)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+186 -88) |
Ship It!
Ship It!