(rr13): handle zero length bit strings
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6880 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -40,6 +40,9 @@ rr13(unsigned char *buf, size_t len)
|
|||||||
unsigned char *tmp;
|
unsigned char *tmp;
|
||||||
int bytes = (len + 7) / 8;
|
int bytes = (len + 7) / 8;
|
||||||
int i;
|
int i;
|
||||||
|
if(len == 0)
|
||||||
|
return;
|
||||||
|
{
|
||||||
const int bits = 13 % len;
|
const int bits = 13 % len;
|
||||||
const int lbit = len % 8;
|
const int lbit = len % 8;
|
||||||
|
|
||||||
@@ -71,6 +74,7 @@ rr13(unsigned char *buf, size_t len)
|
|||||||
buf[i] = (tmp[b1] << s1) | (tmp[b2] >> s2);
|
buf[i] = (tmp[b1] << s1) | (tmp[b2] >> s2);
|
||||||
}
|
}
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add `b' to `a', both beeing one's complement numbers. */
|
/* Add `b' to `a', both beeing one's complement numbers. */
|
||||||
|
Reference in New Issue
Block a user