Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-02-11
22:27 • Ticket [2949740fff] Segfault when open fails with "b" (binary) flag sp... artifact: a74da9dfa7 user: dkf
22:26 • Closed ticket [2949740fff]. artifact: f89d6e6290 user: dkf
21:56 • Ticket [2949740fff]: 4 changes artifact: cd5d3c19d9 user: a_kovalenko
21:56 • Add attachment tcl-openrb-fail-segfault.patch to ticket [2949740fffffff... artifact: 3aa61aa869 user: a_kovalenko
14:56 • New ticket [2949740fff] Segfault when open fails with "b" (binary) fla... artifact: 73d6d0f9a5 user: a_kovalenko

Segfault when open fails with "b" (binary) flag specified

Closed / Fixed2949740fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-02-11 14:56:41
open "|something-nonexistent" rb
=> Segmentation fault

The cause is that Tcl_SetChannelOption is called to set up binary translation, _without_ checking for success, and when [open] fails, NULL channel is passed into this function.

A trivial patch fixing this (one of possible variants, not necessary of the best code style) is attached.
a_kovalenkoplain2010-02-11 21:56:41
File Added - 362522: tcl-openrb-fail-segfault.patch
dkfplain2010-02-11 22:26:56
allow_comments - 1

Was trivial to fix (and a silly error).
dkf Ticket [2949740fff]: 1 change [History diff]2010-02-11 22:27:09
Log in (anonymous is fine) to add a comment.

Attachments: