Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenlib/intern/string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 976c1b0226f..75fa628e701 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -307,8 +307,9 @@ size_t BLI_str_unescape_ex(char *__restrict dst,
{
size_t len = 0;
bool is_complete = true;
+ const size_t max_strlen = dst_maxncpy - 1; /* Account for trailing zero byte. */
for (const char *src_end = src + src_maxncpy; (src < src_end) && *src; src++) {
- if (UNLIKELY(len == dst_maxncpy)) {
+ if (UNLIKELY(len == max_strlen)) {
is_complete = false;
break;
}