1
0
mirror of https://github.com/armink/EasyLogger.git synced 2025-01-19 07:42:52 +08:00

【修复】elog_strcpy 可能存在内存写穿的问题(PS:之前应用层已规避)。

Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
armink 2019-01-04 22:45:58 +08:00
parent 2126c51332
commit 1986ffca2f

View File

@ -1,7 +1,7 @@
/*
* This file is part of the EasyLogger Library.
*
* Copyright (c) 2015-2017, Armink, <armink.ztl@gmail.com>
* Copyright (c) 2015-2018, Armink, <armink.ztl@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -46,7 +46,7 @@ size_t elog_strcpy(size_t cur_len, char *dst, const char *src) {
while (*src != 0) {
/* make sure destination has enough space */
if (cur_len++ <= ELOG_LINE_BUF_SIZE) {
if (cur_len++ < ELOG_LINE_BUF_SIZE) {
*dst++ = *src++;
} else {
break;