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

Index: wireshark-2.4.16/epan/column-utils.c
===================================================================
--- wireshark-2.4.16.orig/epan/column-utils.c
+++ wireshark-2.4.16/epan/column-utils.c
@@ -583,8 +583,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);
+      }
 
       g_strlcat(col_item->col_buf, orig, max_len);
       col_item->col_data = col_item->col_buf;
@@ -632,6 +634,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);
       g_strlcat(col_item->col_buf, orig, max_len);
       col_item->col_data = col_item->col_buf;
     }
openSUSE Build Service is sponsored by