From 39be7109dae72f92db1ea0bb9cff3ac2b8de7ab5 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Tue, 24 Feb 2009 18:31:48 -0500 Subject: [PATCH] Make sure pwmd_command_ap() has a handle and command. --- libpwmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpwmd.c b/libpwmd.c index e1a4ac83..6a224600 100644 --- a/libpwmd.c +++ b/libpwmd.c @@ -115,7 +115,6 @@ pwm_t *pwmd_connect(const char *path, gpg_error_t *error) { pwm_t *pwm = NULL; char *socketpath = NULL; - time_t now; struct passwd *pw; assuan_context_t ctx; int rc, n; @@ -155,8 +154,6 @@ pwm_t *pwmd_connect(const char *path, gpg_error_t *error) pwm->pid = -1; pwm->pinentry_tries = 3; #endif - time(&now); - srandom(now); *error = 0; return pwm; } @@ -702,6 +699,9 @@ gpg_error_t pwmd_command_ap(pwm_t *pwm, char **result, const char *cmd, size_t len; gpg_error_t error; + if (!pwm || !cmd) + return GPG_ERR_INV_ARG; + /* * C99 allows the dst pointer to be null which will calculate the length * of the would-be result and return it. -- 2.11.4.GIT