aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/vendor.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2009-03-29 19:30:29 -0300
committerLeandro A. F. Pereira <leandro@hardinfo.org>2009-03-29 19:30:29 -0300
commit692f2cb05da0d86f365b02d52db0165f4ca230c4 (patch)
tree80f4d045b83b7adc973689d264e69eb62c0509b6 /hardinfo2/vendor.c
parent547287e963402e05d643b793573b1db0dc0d5d57 (diff)
Add null-checks to vendor_*()
Diffstat (limited to 'hardinfo2/vendor.c')
-rw-r--r--hardinfo2/vendor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hardinfo2/vendor.c b/hardinfo2/vendor.c
index f75e4e38..3cc7bf39 100644
--- a/hardinfo2/vendor.c
+++ b/hardinfo2/vendor.c
@@ -81,6 +81,10 @@ static const Vendor vendors[] = {
const gchar *vendor_get_name(const gchar * id)
{
int i;
+
+ if (!id) {
+ return NULL;
+ }
for (i = 0; vendors[i].id; i++) {
if (strstr(id, vendors[i].id))
@@ -94,6 +98,10 @@ const gchar *vendor_get_url(const gchar * id)
{
int i;
+ if (!id) {
+ return NULL;
+ }
+
for (i = 0; vendors[i].id; i++) {
if (strstr(id, vendors[i].id))
return vendors[i].url;