Summary: udev_device_get_sysattr_value(); could return NULL, and using atoi(); with NULL make system crash
Test Plan: It is hard to make a case to retun NULL. I got this from aging test of a product.
Reviewers: cedric, raster, seoz, woohyun, Hermet, jaehwan
Subscribers: cedric, seoz
Differential Revision: https://phab.enlightenment.org/D1687
net->syspath = syspath;
net->name = eina_stringshare_add(name);
idx = udev_device_get_sysattr_value(net->device, "ifindex");
+ if (!idx)
+ {
+ udev_device_unref(net->device);
+ eina_stringshare_del(net->syspath);
+ eina_stringshare_del(net->name);
+
+ free(net);
+ return NULL;
+ }
net->index = atoi(idx);
eina_hash_add(eeze_nets, name, net);
udev_enumerate_unref(en);