subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1631982 - /subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c
Date Wed, 15 Oct 2014 09:44:08 GMT
Author: philip
Date: Wed Oct 15 09:44:07 2014
New Revision: 1631982

URL: http://svn.apache.org/r1631982
Log:
* subversion/libsvn_subr/x509parse.c
  (asn1_get_int): Add comments.

Modified:
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c?rev=1631982&r1=1631981&r2=1631982&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509parse.c Wed Oct 15 09:44:07
2014
@@ -126,12 +126,15 @@ asn1_get_int(const unsigned char **p, co
 
   SVN_ERR(asn1_get_tag(p, end, &len, ASN1_INTEGER));
 
+  /* Reject bit patterns that would overflow the output and those that
+     represent negative values. */
   if (len > (int)sizeof(int) || (**p & 0x80) != 0)
     return svn_error_create(SVN_ERR_ASN1_INVALID_LENGTH, NULL, NULL);
 
   *val = 0;
 
   while (len-- > 0) {
+    /* This would be undefined for bit-patterns of negative values. */
     *val = (*val << 8) | **p;
     (*p)++;
   }



Mime
View raw message