mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
Fix allowing negative offset for snmp_pbuf_stream_seek()
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
349c077feb
commit
0192fe773e
@ -135,7 +135,7 @@ snmp_pbuf_stream_writeto(struct snmp_pbuf_stream *pbuf_stream, struct snmp_pbuf_
|
||||
err_t
|
||||
snmp_pbuf_stream_seek(struct snmp_pbuf_stream *pbuf_stream, s32_t offset)
|
||||
{
|
||||
if ((offset < 0) || (offset > pbuf_stream->length)) {
|
||||
if (((pbuf_stream->offset + offset) < 0) || (offset > pbuf_stream->length)) {
|
||||
/* we cannot seek backwards or forward behind stream end */
|
||||
return ERR_ARG;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user