Commit e4154895 authored by Beniamino Galvani's avatar Beniamino Galvani

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.
parent e3b9606b
......@@ -1222,7 +1222,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment