|
Zbigniew Jędrzejewski-Szmek |
436654 |
From fb9a5b5144ab5654197cd9dab7a339976f10450b Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
From: Ronny Chevalier <chevalier.ronny@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Date: Sat, 30 May 2015 10:51:41 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Subject: [PATCH] networkctl: fix uninitialized variable
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
We ignore the return value of sd_device_get_devtype, then devtype could
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
be uninitialized when used with streq_ptr. So we need to initialize it
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
first.
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
(cherry picked from commit 732b7f39a2b3b1a2af90102c6262186ae71197ac)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
src/network/networkctl.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
index 69b4ab4a5c..3454394977 100644
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
--- a/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+++ b/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
@@ -62,7 +62,7 @@ static int link_get_type_string(int iftype, sd_device *d, char **ret) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
assert(ret);
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
if (iftype == ARPHRD_ETHER && d) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
- const char *devtype, *id = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+ const char *devtype = NULL, *id = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
/* WLANs have iftype ARPHRD_ETHER, but we want
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
* to show a more useful type string for
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
* them */
|