Skip to content

Commit af91744

Browse files
committed
cannot reserve larger than net_buf len
1 parent 4f442c0 commit af91744

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pc/net_socket.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ void net_wtr::add_alloc( str str )
188188

189189
char *net_wtr::reserve( size_t len )
190190
{
191+
if ( len > net_buf::len ) {
192+
return nullptr;
193+
}
191194
size_t nlen = tl_->size_ + len;
192195
if ( nlen > net_buf::len ) {
193196
alloc();

0 commit comments

Comments
 (0)