mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 04:50:07 +01:00
cli: avoid out-of-bounds-read for show_device_info()
Probably not critical, because it will still include the terminating NULL, and just continue to fill the temporary buffer with static addresses. Found by coverity. Fixes:bfb9fd0d2f(cherry picked from commitc274b565a6)
This commit is contained in:
parent
490911c6fa
commit
7fb865947c
1 changed files with 2 additions and 2 deletions
|
|
@ -1116,8 +1116,8 @@ show_device_info (NMDevice *device, NmCli *nmc)
|
|||
(const NMMetaAbstractInfo *const*) nmc_fields_dev_show_general,
|
||||
FALSE, NULL, NULL);
|
||||
|
||||
row = g_new0 (NmcOutputField, _NM_META_SETTING_TYPE_NUM + 1);
|
||||
for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++)
|
||||
row = g_new0 (NmcOutputField, G_N_ELEMENTS (nmc_fields_dev_show_general));
|
||||
for (i = 0; i < G_N_ELEMENTS (nmc_fields_dev_show_general); i++)
|
||||
row[i].info = (const NMMetaAbstractInfo *) &nmc_fields_dev_show_general[i];
|
||||
|
||||
print_required_fields (&nmc->nmc_config, NMC_OF_FLAG_MAIN_HEADER_ONLY,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue