Commit e5857062 authored by Thomas Huth's avatar Thomas Huth Committed by Samuel Thibault
Browse files

slirp: Remove superfluous memset() calls from the TFTP code



Commit fad7fb9c  ("Add IPv6 support to the TFTP code")
refactored some common code for preparing the mbuf into a new
function called tftp_prep_mbuf_data(). One part of this common
code is to do a "memset(m->m_data, 0, m->m_size);" for the related
buffer first. However, at two spots, the memset() was not removed
from the calling function, so it currently done twice in these code
paths. Thus let's delete these superfluous memsets in the calling
functions now.

Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
parent f7725df3
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -208,8 +208,6 @@ static void tftp_send_error(struct tftp_session *spt,
    goto out;
  }

  memset(m->m_data, 0, m->m_size);

  tp = tftp_prep_mbuf_data(spt, m);

  tp->tp_op = htons(TFTP_ERROR);
@@ -237,8 +235,6 @@ static void tftp_send_next_block(struct tftp_session *spt,
    return;
  }

  memset(m->m_data, 0, m->m_size);

  tp = tftp_prep_mbuf_data(spt, m);

  tp->tp_op = htons(TFTP_DATA);