]> git.sur5r.net Git - u-boot/commit
tftp: don't implicity trust the format of recevied packets
authorGrant Likely <grant.likely@secretlab.ca>
Thu, 30 Aug 2007 00:26:24 +0000 (18:26 -0600)
committerWolfgang Denk <wd@denx.de>
Thu, 30 Aug 2007 07:16:16 +0000 (09:16 +0200)
commit8f1bc28408ded213418d9bc0780c7d8fb8a03774
treefbc2ccfd74de779645192fdcafd1a1e09f92bb85
parentd4a68f40a0389bb688477acfd23e957cb19443ad
tftp: don't implicity trust the format of recevied packets

The TFTP OACK code trusts that the incoming packet is formated as
ASCII text and can be processed by string functions. It also has a
loop limit overflow bug where if the packet length is less than 8, it
ends up looping over *all* of memory to find the 'blksize' string.

This patch solves the problem by forcing the packet to be null
terminated and using strstr() to search for the sub string.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
net/tftp.c