* gpgkeys_hkp.c (dehtmlize, parse_hkp_index): Fix memory corruption bug on
authorDavid Shaw <dshaw@jabberwocky.com>
Wed, 9 Apr 2003 01:36:16 +0000 (01:36 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Wed, 9 Apr 2003 01:36:16 +0000 (01:36 +0000)
some platforms.

keyserver/ChangeLog
keyserver/gpgkeys_hkp.c

index 86011ba..2ca7559 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-08  David Shaw  <dshaw@jabberwocky.com>
+
+       * gpgkeys_hkp.c (dehtmlize, parse_hkp_index): Fix memory
+       corruption bug on some platforms.
+
 2003-03-11  David Shaw  <dshaw@jabberwocky.com>
 
        * gpgkeys_hkp.c (get_key): Properly handle CRLF line endings in
index 7cda690..96c8198 100644 (file)
@@ -368,6 +368,8 @@ dehtmlize(char *line)
       while(isspace(((unsigned char *)parsed)[parsedindex]))
        {
          parsed[parsedindex]='\0';
+         if(parsedindex==0)
+           break;
          parsedindex--;
        }
     }
@@ -441,7 +443,7 @@ parse_hkp_index(IOBUF buffer,char *line)
       line++;
 
       tok=strsep(&line,"/");
-      if(tok==NULL)
+      if(tok==NULL || strlen(tok)==0)
        return ret;
 
       if(tok[strlen(tok)-1]=='R')