HomePhabricator

Make parse_name() fail when passed buffer size = 0

Description

Make parse_name() fail when passed buffer size = 0

Summary:
Currently, if you pass an output buffer size of 0 to parse_name() it will
cause an overflow when checking the output buffer space. This change causes the
function to short-circuit and fail when passed a buffer size of 0 instead.

Also adds a test for this scenario.

Depends on D4418

Test Plan:

ninja check-bitcoin-seeder

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5091

Details

Provenance
nakihitoAuthored on Jan 24 2020, 20:18
nakihitoPushed on Mar 3 2020, 18:19
Reviewer
Restricted Owners Package
Differential Revision
D5091: Make parse_name() fail when passed buffer size = 0
Parents
rSTAGINGec625a856ee3: Bump version to 0.21.2
Branches
Unknown
Tags
Unknown