Exploit databaseDownload repository ZIP
GH-1917e82ea4e17d91152ad921475048a4
automateforceai/cve-2018-0202
Sources for CVE-2018-0202
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files12
automateforceai/cve-2018-0202Revision 9964c381baf5
- ↑..Parent directory
- fp_radix_size.c
- fp_read_radix.c
- fp_read_signed_bin.c
- fp_read_unsigned_bin.c
- fp_reverse.c
- fp_s_rmap.c
- fp_signed_bin_size.c
- fp_to_signed_bin.c
- fp_to_unsigned_bin.c
- fp_toradix.c
- fp_toradix_n.c
- fp_unsigned_bin_size.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
clamav-0.99.3/libclamav/tomsfastmath/bin/fp_read_radix.c
C · 1,576 bytes/* TomsFastMath, a fast ISO C bignum library.
*
* This project is meant to fill in where LibTomMath
* falls short. That is speed ;-)
*
* This project is public domain and free for all purposes.
*
* Tom St Denis, [email protected]
*/
#include "bignum_fast.h"
int fp_read_radix(fp_int *a, const char *str, int radix)
{
int y, neg;
char ch;
/* make sure the radix is ok */
if (radix < 2 || radix > 64) {
return FP_VAL;
}
/* if the leading digit is a
* minus set the sign to negative.
*/
if (*str == '-') {
++str;
neg = FP_NEG;
} else {
neg = FP_ZPOS;
}
/* set the integer to the default of zero */
fp_zero (a);
/* process each digit of the string */
while (*str) {
/* if the radix < 36 the conversion is case insensitive
* this allows numbers like 1AB and 1ab to represent the same value
* [e.g. in hex]
*/
ch = (char) ((radix < 36) ? toupper (*str) : *str);
for (y = 0; y < 64; y++) {
if (ch == fp_s_rmap[y]) {
break;
}
}
/* if the char was found in the map
* and is less than the given radix add it
* to the number, otherwise exit the loop.
*/
if (y < radix) {
fp_mul_d (a, (fp_digit) radix, a);
fp_add_d (a, (fp_digit) y, a);
} else {
break;
}
++str;
}
/* set the sign only if a != 0 */
if (fp_iszero(a) != FP_YES) {
a->sign = neg;
}
return FP_OKAY;
}
/* $Source: /cvs/libtom/tomsfastmath/src/bin/fp_read_radix.c,v $ */
/* $Revision: 1.1 $ */
/* $Date: 2006/12/31 21:25:53 $ */