[Pkg-fedora-ds-maintainers] [libapache2-mod-nss] 97/156: Fix parsing error where a token with no password would end up with a trailing tab in its value causing NSS to not find it.

Timo Aaltonen tjaalton-guest at moszumanska.debian.org
Wed Jul 2 13:55:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

tjaalton-guest pushed a commit to branch master
in repository libapache2-mod-nss.

commit 3b2e9ed67b9d67169c4e32d6e2d2a095109d3c10
Author: rcritten <>
Date:   Wed Jul 2 14:54:06 2008 +0000

    Fix parsing error where a token with no password would end up with a
    trailing tab in its value causing NSS to not find it.
    
    If there is no password stored for a token return a 1-byte response
    so that the read on the other end won't time out.
---
 nss_pcache.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/nss_pcache.c b/nss_pcache.c
index 8e0f70f..762dcb7 100644
--- a/nss_pcache.c
+++ b/nss_pcache.c
@@ -410,7 +410,10 @@ int main(int argc, char ** argv)
                 for (node = pinList; node != NULL; node = node->next) {
                     if (!strcmp(node->tokenName, tokenName)) {
                         if (Pk11StoreGetPin(&pin, node->store) == SECSuccess) {
-                            PR_Write(out, pin, strlen(pin));
+                            if (strlen(pin) == 0)
+                                PR_Write(out, "", 1);
+                            else
+                                PR_Write(out, pin, strlen(pin));
                             memset(pin, 0, strlen(pin));
                             free(pin);
                             found = PR_TRUE;
@@ -453,7 +456,7 @@ char * getstr(const char * cmd, int el) {
     while (*s) {
         if (*s == '\t' || *s == '\0') {
             if (i == el) {
-                if (*peek != '\0')
+                if (*peek != '\0' || *s == '\t')
                     *s = '\0';
                 r = strdup(t);
                 free(work);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-fedora-ds/libapache2-mod-nss.git



More information about the Pkg-fedora-ds-maintainers mailing list