svn commit: samba r2122 - in branches/SAMBA_4_0/source/libcli/util:
.
metze at samba.org
metze at samba.org
Tue Aug 31 06:21:14 GMT 2004
Author: metze
Date: 2004-08-31 06:21:14 +0000 (Tue, 31 Aug 2004)
New Revision: 2122
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/libcli/util&rev=2122&nolog=1
Log:
merge from trunk (-r 2120):
Fix bug found by Love H?\195?\182rnquist ?\195?\133strand: asn1_write_Integer needs to push
stuff little endian.
Modified:
branches/SAMBA_4_0/source/libcli/util/asn1.c
Changeset:
Modified: branches/SAMBA_4_0/source/libcli/util/asn1.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/util/asn1.c 2004-08-31 06:18:48 UTC (rev 2121)
+++ branches/SAMBA_4_0/source/libcli/util/asn1.c 2004-08-31 06:21:14 UTC (rev 2122)
@@ -107,15 +107,23 @@
return True;
}
+static void push_int_littleendian(ASN1_DATA *data, int i)
+{
+ uint8_t lowest = i & 0xFF;
+ i = i >> 8;
+ if (i != 0)
+ push_int_littleendian(data, i);
+
+ asn1_write_uint8(data, lowest);
+}
+
+
/* write an integer */
BOOL asn1_write_Integer(ASN1_DATA *data, int i)
{
if (!asn1_push_tag(data, ASN1_INTEGER)) return False;
- do {
- asn1_write_uint8(data, i);
- i = i >> 8;
- } while (i);
+ push_int_littleendian(data, i);
return asn1_pop_tag(data);
}
More information about the samba-cvs
mailing list