[Git][slirp/libslirp][master] tftp: Fix use-after-free

Samuel Thibault (@sthibaul) gitlab at gitlab.freedesktop.org
Thu Apr 25 13:46:51 UTC 2024



Samuel Thibault pushed to branch master at slirp / libslirp


Commits:
c29ec30a by Samuel Thibault at 2024-04-25T15:44:46+02:00
tftp: Fix use-after-free

Spotted thanks to ASAN & fuzzing.

- - - - -


1 changed file:

- src/tftp.c


Changes:

=====================================
src/tftp.c
=====================================
@@ -248,12 +248,12 @@ static void tftp_send_next_block(struct tftp_session *spt,
                              spt->block_size);
 
     if (nobytes < 0) {
-        m_free(m);
-
         /* send "file not found" error back */
 
         tftp_send_error(spt, 1, "File not found", tp);
 
+        m_free(m);
+
         return;
     }
 



View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/c29ec30a655504778e8724bdd401b9afec6820e5

-- 
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/c29ec30a655504778e8724bdd401b9afec6820e5
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20240425/735b9f80/attachment.htm>


More information about the Slirp mailing list