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:
Thomas Haller 2021-06-01 17:44:08 +02:00
parent bc05f4b750
commit dd4cccbe66
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 8 additions and 2 deletions

View file

@ -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;

View file

@ -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';