summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2009-06-23 18:21:45 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 22:30:09 +0100
commit33a6e969fe2490a73bb6384147292c4df4116e02 (patch)
tree230014b1efc7f921f46fd47fb4fca9ee1cc4b951 /plugin
parentb3eeac6a66c4cb0f6d919de3383f27a2e8f6e4d2 (diff)
downloadfribid-33a6e969fe2490a73bb6384147292c4df4116e02.tar.gz
fribid-33a6e969fe2490a73bb6384147292c4df4116e02.tar.bz2
fribid-33a6e969fe2490a73bb6384147292c4df4116e02.zip
Fixed a NULL dereference bug
Diffstat (limited to 'plugin')
-rw-r--r--plugin/plugin.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugin/plugin.c b/plugin/plugin.c
index 295a148..899fadd 100644
--- a/plugin/plugin.c
+++ b/plugin/plugin.c
@@ -103,11 +103,25 @@ bool sign_setParam(Plugin *plugin, const char *name, const char *value) {
return true;
}
+static bool hasSignParams(const Plugin *plugin) {
+ return (plugin->info.auth.challenge && plugin->info.auth.policys);
+}
+
int sign_performAction(Plugin *plugin, const char *action) {
+ plugin->lastError = PE_UnknownError;
if ((plugin->type == PT_Authentication) && !strcmp(action, "Authenticate")) {
- return sign_performAction_Authenticate(plugin);
+ if (!hasSignParams(plugin)) {
+ return 1;
+ } else {
+ return sign_performAction_Authenticate(plugin);
+ }
} else if ((plugin->type == PT_Signer) && !strcmp(action, "Sign")) {
- return sign_performAction_Sign(plugin);
+ if (!hasSignParams(plugin) || !plugin->info.sign.subjectFilter ||
+ !plugin->info.sign.message) {
+ return 1;
+ } else {
+ return sign_performAction_Sign(plugin);
+ }
} else {
return 1;
}