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

Diff for /src/usr.bin/ssh/sshbuf-misc.c between version 1.6 and 1.7

version 1.6, 2016/05/02 08:49:03 version 1.7, 2019/07/07 01:05:00
Line 91 
Line 91 
         size_t len = sshbuf_len(buf), plen;          size_t len = sshbuf_len(buf), plen;
         const u_char *p = sshbuf_ptr(buf);          const u_char *p = sshbuf_ptr(buf);
         char *ret;          char *ret;
         int r;  
   
         if (len == 0)          if (len == 0)
                 return strdup("");                  return strdup("");
         plen = ((len + 2) / 3) * 4 + 1;          plen = ((len + 2) / 3) * 4 + 1;
         if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL)          if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL)
                 return NULL;                  return NULL;
         if ((r = b64_ntop(p, len, ret, plen)) == -1) {          if (b64_ntop(p, len, ret, plen) == -1) {
                 explicit_bzero(ret, plen);                  explicit_bzero(ret, plen);
                 free(ret);                  free(ret);
                 return NULL;                  return NULL;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7