trusted-keys: check for NULL before using it
[linux-2.6.git] / security / keys / trusted_defined.c
index 7b21795..f7d0677 100644 (file)
@@ -148,6 +148,11 @@ static int TSS_authhmac(unsigned char *digest, const unsigned char *key,
                if (dlen == 0)
                        break;
                data = va_arg(argp, unsigned char *);
+               if (!data) {
+                       ret = -EINVAL;
+                       va_end(argp);
+                       goto out;
+               }
                ret = crypto_shash_update(&sdesc->shash, data, dlen);
                if (ret < 0) {
                        va_end(argp);