Opened 12 years ago

Last modified 7 years ago

#662 closed defect (Fixed)

wrong size for allocation

Reported by: aakova Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.2.0.23-rc
Severity: Keywords:
Cc: aakova Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

[tor/src/or/dirvote.c:networkstatus_compute_consensus: ~644]

int *named_flag; /* Index of the flag "Named" for votes[j] */
int *unnamed_flag; /* Index of the flag "Unnamed" for votes[j] */

[...]

named_flag = tor_malloc_zero(sizeof(int*) * smartlist_len(votes));

^
|

[ This looks wrong, probably we should be using 'sizeof(int)' in the allocation. Probably only affects 64-bit systems. ]

[ Same problem on the next line too: ]

unnamed_flag = tor_malloc_zero(sizeof(int*) * smartlist_len(votes));

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (3)

comment:1 Changed 12 years ago by nickm

Thanks! This should be fixed in r14391 (trunk) and r14391 (1.4 branch).

comment:2 Changed 12 years ago by nickm

flyspray2trac: bug closed.

comment:3 Changed 7 years ago by nickm

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