[Git][slirp/libslirp][master] Fix assertion

Samuel Thibault (@sthibaul) gitlab at gitlab.freedesktop.org
Thu Jan 30 01:31:47 UTC 2025



Samuel Thibault pushed to branch master at slirp / libslirp


Commits:
aad57fd4 by Samuel Thibault at 2025-01-30T02:31:26+01:00
Fix assertion

- - - - -


1 changed file:

- src/sbuf.c


Changes:

=====================================
src/sbuf.c
=====================================
@@ -172,7 +172,7 @@ void sbcopy(struct sbuf *sb, size_t off, size_t len, char *to)
     if (ptr_diff == 0 && sb->sb_cc != 0 && sb->sb_cc != sb->sb_datalen) {
         g_error("sbcopy: ptr_diff == 0: sb->sb_cc (%" PRIu32 ") != sb->sb_datalen (%" PRIu32 "), sb->sb_cc != 0\n",
                    sb->sb_cc, sb->sb_datalen);
-    } else if (ptr_diff != (size_t) sb->sb_cc) {
+    } else if (ptr_diff != 0 && ptr_diff != (size_t) sb->sb_cc) {
         g_error("sbcopy: ptr_diff (%" SLIRP_PRIssize_t ") != sb->sb_cc (%" PRIu32 ")\n", ptr_diff, sb->sb_cc);
     } else if (len + off > (size_t) sb->sb_cc) {
         g_error("sbcopy: len (%" SLIRP_PRIsize_t ") + off (%" SLIRP_PRIsize_t ") > sb->sb_cc (%" PRIu32 ")\n",



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

-- 
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/aad57fd45736f818d08f793f37a4cb67717c9122
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/20250130/1919626c/attachment.htm>


More information about the Slirp mailing list