mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 17:32:43 +00:00
Unceremoneously discard HDLC frames with less than two bytes in them.
XXX: real fix: this could should check the number of bytes in the packet before accessing them. Found by: phkmalloc
This commit is contained in:
parent
748c4cdf38
commit
6b5f0ac2a3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25019
@ -17,7 +17,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: hdlc.c,v 1.11 1997/02/22 16:10:16 peter Exp $
|
||||
*
|
||||
* TODO:
|
||||
*/
|
||||
@ -334,6 +334,12 @@ HdlcInput(struct mbuf *bp)
|
||||
}
|
||||
if (!DEV_IS_SYNC)
|
||||
bp->cnt -= 2; /* discard FCS part */
|
||||
|
||||
if (bp->cnt < 2) { /* XXX: raise this bar ? */
|
||||
bfree(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
cp = MBUF_CTOP(bp);
|
||||
|
||||
ifInPackets++;
|
||||
|
Loading…
Reference in New Issue
Block a user