Commit 78f20049 authored by Adam Langley's avatar Adam Langley Committed by android-build-merger
Browse files

Fix encoding bug in i2c_ASN1_INTEGER

am: c313c682

* commit 'c313c682':
  Fix encoding bug in i2c_ASN1_INTEGER

Change-Id: I4a6e0743464d3305d4d043dfab54790ac8baf49a
parents c042e7ed c313c682
......@@ -125,6 +125,8 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
{
ret=a->length;
i=a->data[0];
if (ret == 1 && i == 0)
neg=0;
if (!neg && (i > 127)) {
pad=1;
pb=0;
......@@ -158,7 +160,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
p += a->length - 1;
i = a->length;
/* Copy zeros to destination as long as source is zero */
while(!*n) {
while(!*n && i > 1) {
*(p--) = 0;
n--;
i--;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment