projects
/
platform
/
core
/
system
/
resourced.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a64de7
)
swap: Add +1 to strlen() for strncmp
41/315741/1
accepted/tizen/unified/20241205.173755
accepted/tizen/unified/x/20241218.032531
accepted/tizen/unified/x/asan/20241224.004258
author
Unsung Lee
<unsung.lee@samsung.com>
Wed, 4 Dec 2024 08:01:46 +0000
(17:01 +0900)
committer
Unsung Lee
<unsung.lee@samsung.com>
Wed, 4 Dec 2024 08:01:49 +0000
(17:01 +0900)
Add plus 1 to return value of strlen() to compare two strings
using strncmp().
Change-Id: I198f680f475f3028f03afc3d4933508556705b61
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-optimizer/memory/swap/swap.c
patch
|
blob
|
history
diff --git
a/src/resource-optimizer/memory/swap/swap.c
b/src/resource-optimizer/memory/swap/swap.c
index 3c5ee30d487f4b4c91de71a7cbec524df0ba304c..ab14075f55781635050757cce44516e799b78ec4 100644
(file)
--- a/
src/resource-optimizer/memory/swap/swap.c
+++ b/
src/resource-optimizer/memory/swap/swap.c
@@
-267,7
+267,7
@@
static int swap_use_force_reclaim(char *memcg)
* But instead, try to swap memory as much as possible.
* It will be happend only once after booting done.
*/
- len = strlen(memcg);
+ len = strlen(memcg)
+ 1
;
if (!strncmp(memcg, MEMCG_PATH, len))
root_memcg = true;