diff --git a/libfwnetconfig/pci.c b/libfwnetconfig/pci.c index d932ab5..262701b 100644 --- a/libfwnetconfig/pci.c +++ b/libfwnetconfig/pci.c @@ -48,7 +48,10 @@ static char* fwnet_ifbusid(const char *iface) } fclose(fp); /* strip the trailing newline */ - ret[strlen(ret)-1] = 0; + if (ret) + { + ret[strlen(ret)-1] = 0; + } } return ret;