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

Diff for /src/usr.bin/ldap/Attic/ber.c between version 1.4 and 1.5

version 1.4, 2018/06/27 20:38:10 version 1.5, 2018/06/29 15:18:03
Line 729 
Line 729 
                                 goto fail;                                  goto fail;
                         ber = parent[level--];                          ber = parent[level--];
                         ret++;                          ret++;
                         continue;                          break;
                 default:                  default:
                         goto fail;                          goto fail;
                 }                  }
Line 822 
Line 822 
 }  }
   
 void  void
   ber_free_element(struct ber_element *root)
   {
           if (root->be_sub && (root->be_encoding == BER_TYPE_SEQUENCE ||
               root->be_encoding == BER_TYPE_SET))
                   ber_free_elements(root->be_sub);
           if (root->be_free && (root->be_encoding == BER_TYPE_OCTETSTRING ||
               root->be_encoding == BER_TYPE_BITSTRING ||
               root->be_encoding == BER_TYPE_OBJECT))
                   free(root->be_val);
           free(root);
   }
   
   void
 ber_free_elements(struct ber_element *root)  ber_free_elements(struct ber_element *root)
 {  {
         if (root->be_sub && (root->be_encoding == BER_TYPE_SEQUENCE ||          if (root->be_sub && (root->be_encoding == BER_TYPE_SEQUENCE ||
Line 1030 
Line 1043 
                 return 1;                  return 1;
         }          }
   
           if (u == 0x80) {
                   /* Indefinite length not supported. */
                   errno = EINVAL;
                   return -1;
           }
   
         n = u & ~BER_TAG_MORE;          n = u & ~BER_TAG_MORE;
         if (sizeof(ssize_t) < n) {          if (sizeof(ssize_t) < n) {
                 errno = ERANGE;                  errno = ERANGE;
Line 1046 
Line 1065 
         if (s < 0) {          if (s < 0) {
                 /* overflow */                  /* overflow */
                 errno = ERANGE;                  errno = ERANGE;
                 return -1;  
         }  
   
         if (s == 0) {  
                 /* invalid encoding */  
                 errno = EINVAL;  
                 return -1;                  return -1;
         }          }
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5