Opened 12 years ago

Last modified 7 years ago

#528 closed defect (Fixed)

failure case memory leak in base32_decode

Reported by: ghazel Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.2.0.7-alpha
Severity: Keywords:
Cc: ghazel Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

It's trivial, but base32_decode mallocates a "tmp" variable which is not freed in the "illegal character in base32 encoded string" case.

...

/* Convert base32 encoded chars to the 5-bit values that they represent. */
tmp = tor_malloc_zero(srclen);
for (j = 0; j < srclen; ++j) {

if (src[j] > 0x60 && src[j] < 0x7B) tmp[j] = src[j] - 0x61;
else if (src[j] > 0x31 && src[j] < 0x38) tmp[j] = src[j] - 0x18;
else {

log_warn(LD_BUG, "illegal character in base32 encoded string");
return -1;

}

}

...

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (3)

comment:1 Changed 12 years ago by nickm

Thanks! Fixed in subversion revision r11946; the revision should be in 0.2.0.9-alpha.

comment:2 Changed 12 years ago by nickm

flyspray2trac: bug closed.

comment:3 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.