diff --git a/src/netbios_session.c b/src/netbios_session.c index 25925b2..a56c0cc 100644 --- a/src/netbios_session.c +++ b/src/netbios_session.c @@ -246,7 +246,7 @@ int netbios_session_packet_append(netbios_session *s, assert(s && s->packet); if (s->packet_payload_size - s->packet_cursor < size) - if (!session_buffer_realloc(s, size + s->packet_cursor)) + if (!session_buffer_realloc(s, size + s->packet_cursor + sizeof(netbios_session_packet))) return 0; start = ((char *)&s->packet->payload) + s->packet_cursor;