mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 10:30:13 +01:00
lgtm: suppress [cpp/alloca-in-loop] warnings for lgtm.com
The warning is not right. There is no unguarded number of alloca() calls inside a loop. Suppress the warnings.
This commit is contained in:
parent
bc05f4b750
commit
dd4cccbe66
2 changed files with 8 additions and 2 deletions
|
|
@ -1866,7 +1866,9 @@ clear_secrets(const NMSettInfoSetting * sett_info,
|
|||
if (j++ < 5) {
|
||||
/* we use alloca() inside a loop here, but it is guarded to happen at most
|
||||
* a few times. */
|
||||
name = peers_psk_get_secret_name_a(peer->public_key, &name_free);
|
||||
name = peers_psk_get_secret_name_a(/* lgtm [cpp/alloca-in-loop] */
|
||||
peer->public_key,
|
||||
&name_free);
|
||||
} else {
|
||||
name_free = peers_psk_get_secret_name_dup(peer->public_key);
|
||||
name = name_free;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,11 @@ _value_str_as_index_list(const char *value, gsize *out_len)
|
|||
if (!str_cloned) {
|
||||
/* we use alloca() inside a loop here, but it is guarded to happen at most once. */
|
||||
str_cloned = TRUE;
|
||||
str = nm_strndup_a(200, str, strlen(str), &str_clone_free);
|
||||
str = nm_strndup_a(/* lgtm [cpp/alloca-in-loop] */
|
||||
200,
|
||||
str,
|
||||
strlen(str),
|
||||
&str_clone_free);
|
||||
}
|
||||
s = str;
|
||||
str[good] = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue