File CVE-2025-5601.patch of Package wireshark.39235

Index: wireshark-3.6.24/epan/column-utils.c
===================================================================
--- wireshark-3.6.24.orig/epan/column-utils.c
+++ wireshark-3.6.24/epan/column-utils.c
@@ -578,8 +578,10 @@ col_prepend_fstr(column_info *cinfo, con
       /*
        * Move the fence, unless it's at the beginning of the string.
        */
-      if (col_item->col_fence > 0)
+      if (col_item->col_fence > 0) {
         col_item->col_fence += (int) strlen(col_item->col_buf);
+        col_item->col_fence = MIN((int)(max_len - 1), col_item->col_fence);
+      }
 
       (void) g_strlcat(col_item->col_buf, orig, max_len);
       col_item->col_data = col_item->col_buf;
@@ -627,6 +629,7 @@ col_prepend_fence_fstr(column_info *cinf
       } else {
         col_item->col_fence = (int) strlen(col_item->col_buf);
       }
+      col_item->col_fence = MIN((int)(max_len - 1), col_item->col_fence);
       (void) g_strlcat(col_item->col_buf, orig, max_len);
       col_item->col_data = col_item->col_buf;
     }
openSUSE Build Service is sponsored by