[Slirp] [PATCH] slirp: use correct size while emulating IRC commands

P J P ppandit at redhat.com
Thu Jan 9 09:02:47 UTC 2020


+-- On Wed, 8 Jan 2020, Philippe Mathieu-Daudé wrote --+
| >               m->m_len = bptr - m->m_data; /* Adjust length */
| > -            m->m_len += snprintf(bptr, m->m_size, "DCC CHAT chat %lu
| > %u%c\n",
| > +            m->m_len += snprintf(bptr, M_ROOM(m) - m->m_len,
| 
| Why not use M_FREEROOM() instead?

Ah indeed, (M_ROOM(m) - m->m_len) is => M_FREEROOM().

In my head I was thinking 'm->m_len' is larger.

   m->m_len = bptr - m->m_data; /* Adjust length */

But after above adjustment, M_FREEROOM() would return the same free size.

Sending patch v2 in a bit.

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D


More information about the Slirp mailing list