The index variable for the current parameter was being reused to parse
the fingerprint, resulting in attempting to free an unallocated piece of
memory and crashing. Use a different loop variable instead.
{
char **params = NULL;
int op = OP_UNKNOWN;
- int i;
+ int i, j;
int indx = 0;
bool dispfp = false;
bool skshash = false;
if (search != NULL && strlen(search) == 42 &&
search[0] == '0' && search[1] == 'x') {
fingerprint.length = MAX_FINGERPRINT_LEN;
- for (i = 0; i < MAX_FINGERPRINT_LEN; i++) {
- fingerprint.fp[i] = (hex2bin(
- search[2 + i * 2])
+ for (j = 0; j < MAX_FINGERPRINT_LEN; j++) {
+ fingerprint.fp[j] = (hex2bin(
+ search[2 + j * 2])
<< 4) +
- hex2bin(search[3 + i * 2]);
+ hex2bin(search[3 + j * 2]);
}
isfp = true;
} else if (search != NULL) {