]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: fix possible use of uninitialized value
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 10 Nov 2018 07:05:05 +0000 (16:05 +0900)
committerLennart Poettering <lennart@poettering.net>
Sat, 10 Nov 2018 10:59:32 +0000 (11:59 +0100)
src/libsystemd/sd-device/device-private.c

index fa0829885aa50bf63b31264fd40c90ab806c0b63..8cc216c353985eacbf811738ee1bfb692a0f25ff 100644 (file)
@@ -550,7 +550,7 @@ int device_new_from_strv(sd_device **ret, char **strv) {
         char **key;
         const char *major = NULL, *minor = NULL;
         DeviceAction action = _DEVICE_ACTION_INVALID;
-        uint64_t seqnum;
+        uint64_t seqnum = 0;
         int r;
 
         assert(ret);
@@ -585,7 +585,7 @@ int device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len) {
         _cleanup_(sd_device_unrefp) sd_device *device = NULL;
         const char *major = NULL, *minor = NULL;
         DeviceAction action = _DEVICE_ACTION_INVALID;
-        uint64_t seqnum;
+        uint64_t seqnum = 0;
         unsigned i = 0;
         int r;