mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 18:30:11 +01:00
shared/nm-utils: avoid a coverity warning
1. NetworkManager-1.14.0/shared/nm-utils/nm-shared-utils.c:1242: value_overwrite: Overwriting previous write to "ch" with value from "v".
2. NetworkManager-1.14.0/shared/nm-utils/nm-shared-utils.c:1239: assigned_value: Assigning value from "++str[0]" to "ch" here, but that stored value is overwritten before it can be used.
# 1237| if (ch >= '0' && ch <= '7') {
# 1238| v = v * 8 + (ch - '0');
# 1239|-> ch = (++str)[0];
# 1240| }
# 1241| }
Don't assign ch when it is going to be overwritten.
(cherry picked from commit e4154895ff)
This commit is contained in:
parent
8cbc08ce29
commit
8fb85b1f5b
1 changed files with 1 additions and 1 deletions
|
|
@ -1236,7 +1236,7 @@ nm_utils_buf_utf8safe_unescape (const char *str, gsize *out_len, gpointer *to_fr
|
|||
ch = (++str)[0];
|
||||
if (ch >= '0' && ch <= '7') {
|
||||
v = v * 8 + (ch - '0');
|
||||
ch = (++str)[0];
|
||||
++str;
|
||||
}
|
||||
}
|
||||
ch = v;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue