diff options
author | Samuel Lidén Borell <samuel@primekey.se> | 2011-08-03 10:55:26 (GMT) |
---|---|---|
committer | Samuel Lidén Borell <samuel@primekey.se> | 2011-08-03 10:55:26 (GMT) |
commit | 4b57bea6aec8929d09f9533f3b97d415d1a2fb60 (patch) | |
tree | 2d34ecdacce99a1ad0fa7b739656cba9db40cafe | |
parent | e9bcba23438c67217a2bca1b2322e8e03d70594f (diff) | |
download | fribid-4b57bea6aec8929d09f9533f3b97d415d1a2fb60.zip fribid-4b57bea6aec8929d09f9533f3b97d415d1a2fb60.tar.gz fribid-4b57bea6aec8929d09f9533f3b97d415d1a2fb60.tar.bz2 |
Fix string comparison in StoreCertificates
The NPAPI spec doesn't require strings to be null terminated, and some
browsers such as Chromium don't do this. This patch fixes the string
comparison to even if the string is not null terminated.
-rw-r--r-- | plugin/npobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/npobject.c b/plugin/npobject.c index b328063..c292dbd 100644 --- a/plugin/npobject.c +++ b/plugin/npobject.c @@ -177,7 +177,7 @@ static bool objInvokeSafe(PluginObject *this, const char *name, const NPString *type_nps = &NPVARIANT_TO_STRING(args[0]); bool type_is_p7c = (type_nps->utf8length == 3 && - !strcmp(type_nps->utf8characters, "p7c")); + !strncmp(type_nps->utf8characters, "p7c", 3)); char *certs = variantToStringZ(&args[1]); // TODO set the error code instead of just failing and throwing a script exception |