[BACK]Return to bufaux.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/Attic/bufaux.c between version 1.54 and 1.57

version 1.54, 2014/01/12 08:13:13 version 1.57, 2014/04/16 23:22:45
Line 214 
Line 214 
                 if (cp == ret + length - 1)                  if (cp == ret + length - 1)
                         error("buffer_get_cstring_ret: string contains \\0");                          error("buffer_get_cstring_ret: string contains \\0");
                 else {                  else {
                         bzero(ret, length);                          explicit_bzero(ret, length);
                         free(ret);                          free(ret);
                         return NULL;                          return NULL;
                 }                  }
Line 344 
Line 344 
         }          }
         ret = xmalloc(len);          ret = xmalloc(len);
         memcpy(ret, p, len);          memcpy(ret, p, len);
         memset(p, '\0', len);          explicit_bzero(p, len);
         free(bin);          free(bin);
         return ret;          return ret;
 }  }
Line 370 
Line 370 
   
         if (l > 8 * 1024)          if (l > 8 * 1024)
                 fatal("%s: length %u too long", __func__, l);                  fatal("%s: length %u too long", __func__, l);
           /* Skip leading zero bytes */
           for (; l > 0 && *s == 0; l--, s++)
                   ;
         p = buf = xmalloc(l + 1);          p = buf = xmalloc(l + 1);
         /*          /*
          * If most significant bit is set then prepend a zero byte to           * If most significant bit is set then prepend a zero byte to
Line 381 
Line 384 
         }          }
         memcpy(p, s, l);          memcpy(p, s, l);
         buffer_put_string(buffer, buf, l + pad);          buffer_put_string(buffer, buf, l + pad);
         memset(buf, '\0', l + pad);          explicit_bzero(buf, l + pad);
         free(buf);          free(buf);
 }  }
   

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.57