changeset 1872:c1d0187f0959

Check for NULL parameters in caps functions
author franky
date Mon, 05 Apr 2010 11:40:00 +0200
parents fdb2f88b908b
children 1f5015ef43e8
files mcabber/mcabber/caps.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/caps.c	Sun Apr 04 00:15:53 2010 +0200
+++ b/mcabber/mcabber/caps.c	Mon Apr 05 11:40:00 2010 +0200
@@ -1,7 +1,7 @@
 /*
  * caps.c       -- Entity Capabilities Cache for mcabber
  *
- * Copyright (C) 2008 Frank Zschockelt <mcabber@freakysoft.de>
+ * Copyright (C) 2008-2010 Frank Zschockelt <mcabber@freakysoft.de>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -75,7 +75,7 @@
                        const char *type)
 {
   caps *c;
-  if (!hash)
+  if (!hash || !category || !name || !type)
     return;
 
   c = g_hash_table_lookup(caps_cache, hash);
@@ -89,7 +89,7 @@
 void caps_add_feature(char *hash, const char *feature)
 {
   caps *c;
-  if (!hash)
+  if (!hash || !feature)
     return;
   c = g_hash_table_lookup(caps_cache, hash);
   if (c) {
@@ -101,7 +101,7 @@
 int caps_has_feature(char *hash, char *feature)
 {
   caps *c;
-  if (!hash)
+  if (!hash || !feature)
     return 0;
   c = g_hash_table_lookup(caps_cache, hash);
   if (c)