Opened 8 years ago

Closed 8 years ago

#5141 closed defect (fixed)

obfsproxy Segmentation fault on incomplete command line

Reported by: murble Owned by: asn
Priority: Medium Milestone:
Component: Archived/Obfsproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

gdb obfsproxy
[...]
run obfs2 --dest=127.0.0.1:666 server
Program received signal SIGSEGV, Segmentation fault.
0x000000000040820b in xstrdup (s=0x0) at src/util.c:100
100 return xmemdup(s, strlen(s) + 1);
(gdb) bt
#0 0x000000000040820b in xstrdup (s=0x0) at src/util.c:100
#1 0x000000000040835d in resolve_address_port (address=0x0, nodns=1,

passive=1, default_port=0x4113e4 "11253") at src/util.c:172

#2 0x0000000000409c43 in parse_and_set_options (n_options=2,

options=0x7fffffffe348, cfg=0x616160) at src/protocols/obfs2.c:222

#3 0x0000000000409829 in obfs2_config_create (n_options=2,

options=0x7fffffffe338) at src/protocols/obfs2.c:107

#4 0x0000000000406503 in config_create (n_options=3, options=0x7fffffffe330)

at src/protocol.c:49

#5 0x000000000040f466 in launch_external_proxy (begin=0x7fffffffe330)

at src/external.c:58

#6 0x0000000000402c77 in obfs_main (argc=4, argv=0x7fffffffe328)

at src/main.c:296

#7 0x0000000000402524 in main (argc=4, argv=0x7fffffffe328)

at src/obfs_main.c:23

Child Tickets

Change History (8)

comment:1 Changed 8 years ago by nickm

Status: newneeds_review

See branch bug5141 in my public repository.

comment:2 Changed 8 years ago by Sebastian

looks good to me

comment:3 Changed 8 years ago by arma

Your branch looks fine, but: how does smartlist_get(split_bindaddr, 1) get to be null if smartlist_len(split_bindaddr) is 2?

comment:4 in reply to:  3 Changed 8 years ago by arma

Replying to arma:

Your branch looks fine, but: how does smartlist_get(split_bindaddr, 1) get to be null if smartlist_len(split_bindaddr) is 2?

Disregard. I was looking at managed.c, not realizing there was a protocols/ directory.

comment:5 Changed 8 years ago by asn

Status: needs_reviewneeds_revision

Hm, this patch looks like a work around of the actual bug in protocols/obfs2.c:parse_and_set_options().

We should probably keep Nick's patch, but also fix the bad CLI parsing code in protocols/obfs2.c. I think the problem there is that we trust n_options too much, which does not work well when we have optional arguments.

Unfortunately, I don't have a computer at the moment to prepare a fix. I'll do ASAP, if no one else does it.

comment:6 Changed 8 years ago by nickm

ok, will wait for the better version to merge my thing and yours.

comment:7 Changed 8 years ago by asn

Status: needs_revisionneeds_review

Please see branch bug5141 in https://git.gitorious.org/obfsproxy/obfsproxy.git.

comment:8 Changed 8 years ago by asn

Resolution: fixed
Status: needs_reviewclosed

Merged my branch and nick's branch.
Thanks!

Note: See TracTickets for help on using tickets.