settings/ifupdown: fix block_name typo in initialize()

In commit f0938948bc a typo creeped in and
"block->name" got replaced by "block_name". Variable block_name is used
for a different purpose and not initialized at this point.
As a result g_str_has_prefix crashes with a segfault.

Spotted by Bernhard Übelacker <bernhardu@mailbox.org>

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911621
Fixes: f0938948bc

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/31
(cherry picked from commit 8179b23d76)
This commit is contained in:
Michael Biebl 2018-10-23 19:52:52 +02:00 committed by Lubomir Rintel
parent 576f0877f3
commit 0ffb390bf3

View file

@ -171,7 +171,7 @@ initialize (NMSettingsPlugin *plugin)
if (nm_streq (block->type, "iface")) {
/* Bridge configuration */
if (g_str_has_prefix (block_name, "br")) {
if (g_str_has_prefix (block->name, "br")) {
/* Try to find bridge ports */
const char *ports = ifparser_getkey (block, "bridge-ports");