Opened 9 years ago

Last modified 7 years ago

#1255 closed defect (Fixed)

correct NULL check on desc in rend_encode_v2_descriptors

Reported by: ekir Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.2.2.7-alpha
Severity: Keywords:
Cc: ekir, Sebastian Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

desc is dereferenced with desc->pk, and then checked for NULL.

rendcommon.c:459,469

crypto_pk_env_t *service_key = auth_type == REND_STEALTH_AUTH ?

client_key : desc->pk;

tor_assert(service_key);
if (auth_type == REND_STEALTH_AUTH) {

descriptor_cookie = smartlist_get(client_cookies, 0);
tor_assert(descriptor_cookie);

}
if (!desc) {

log_warn(LD_REND, "Could not encode v2 descriptor: No desc given.");
return -1;

}

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (4)

comment:1 Changed 9 years ago by Sebastian

Nice catch. I think we should assert here, but I'm checking with karsten before I
put up that patch.

comment:2 Changed 9 years ago by Sebastian

After talking to karsten, we decided that warning with LD_BUG is a good idea here.
Branch bug1255 in my repo.

comment:3 Changed 9 years ago by Sebastian

flyspray2trac: bug closed.

comment:4 Changed 7 years ago by nickm

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