From bca1d8c38241541d1df031f227280b9d762728ed Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Fri, 20 Apr 2018 18:30:21 +0200 Subject: QByteArray: Add a note regarding overlapping pointers to qstr(n)cpy Stated e.g. in http://en.cppreference.com/w/c/string/byte/strcpy Change-Id: I42fd5a5fa6a63b67a7105aa56e93e3d3f2193cf7 Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 421e716d14..b589f78a28 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -261,6 +261,8 @@ char *qstrdup(const char *src) This function assumes that \a dst is large enough to hold the contents of \a src. + \note If \a dst and \a src overlap, the behavior is undefined. + \sa qstrncpy() */ @@ -292,6 +294,8 @@ char *qstrcpy(char *dst, const char *src) This function assumes that \a dst is at least \a len characters long. + \note If \a dst and \a src overlap, the behavior is undefined. + \note When compiling with Visual C++ compiler version 14.00 (Visual C++ 2005) or later, internally the function strncpy_s will be used. -- cgit v1.2.3