File CVE-2025-3548.patch of Package assimp.19344

--- a/include/assimp/types.h.smb	2026-01-22 11:15:40.902474195 -0500
+++ b/include/assimp/types.h	2026-01-22 11:22:49.865360626 -0500
@@ -304,12 +304,21 @@
     }
 
     /** Copy a const char* to the aiString */
-    void Set(const char *sz) {
-        ai_int32 len = (ai_uint32)::strlen(sz);
-        if (len > (ai_int32)MAXLEN - 1) {
-            len = (ai_int32) MAXLEN - 1;
+    void Set(const char *sz, size_t maxlen) {
+        if (sz == nullptr) {
+            return;
         }
-        length = len;
+        size_t len = 0;
+        for (size_t i=0; i<maxlen; ++i) {
+            if (sz[i] == '\0') {
+                break;
+            }
+            ++len;
+        }
+        if (len > MAXLEN - 1) {
+            len = MAXLEN - 1;
+        }
+        length = static_cast<uint32_t>(len);
         memcpy(data, sz, len);
         data[len] = 0;
     }
openSUSE Build Service is sponsored by