$OpenBSD: patch-src_qt_qtbase_src_corelib_tools_qbytearray_cpp,v 1.1 2017/07/05 11:54:22 sthen Exp $

Index: src/qt/qtbase/src/corelib/tools/qbytearray.cpp
--- src/qt/qtbase/src/corelib/tools/qbytearray.cpp.orig
+++ src/qt/qtbase/src/corelib/tools/qbytearray.cpp
@@ -150,12 +150,15 @@ int qAllocMore(int alloc, int extra) Q_DECL_NOTHROW
 
 char *qstrdup(const char *src)
 {
+    size_t sz = strlen(src) + 1;
     if (!src)
         return 0;
-    char *dst = new char[strlen(src) + 1];
-    return qstrcpy(dst, src);
+    char *dst = new char[sz];
+    memcpy(dst, src, sz);
+    return dst;
 }
 
+#ifndef Q_OS_OPENBSD
 /*! \relates QByteArray
 
     Copies all the characters up to and including the '\\0' from \a
@@ -183,6 +186,7 @@ char *qstrcpy(char *dst, const char *src)
     return strcpy(dst, src);
 #endif
 }
+#endif
 
 /*! \relates QByteArray
 
@@ -199,8 +203,6 @@ char *qstrcpy(char *dst, const char *src)
     \note When compiling with Visual C++ compiler version 14.00
     (Visual C++ 2005) or later, internally the function strncpy_s
     will be used.
-
-    \sa qstrcpy()
 */
 
 char *qstrncpy(char *dst, const char *src, uint len)
