Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6144984a28853f1f11fe7f9e92746fc67ccde7903835daa2a327e329197dc30f
Ticket: 00d04c4f120904aa0c6bd76d542d57f4a0dd2eb3
base64 transchan over a refchan: segmentation fault
User & Date: sebres on 2018-11-15 16:20:48
Changes

  1. assignee changed to: "sebres"
  2. icomment:
    I have rewritten this for debug purposes without tcllib and simplest proc-handlers with debugging info:
    
    This produces following result...
    <code><pre style="padding:10pt;">
      *********** initialize rc0 {read write} -
    push rc0 ...
      *********== initialize rt0 {read write} -
    read from rc0 ...
      *********** read rc0 4096 - current pos: 0, current buf: 189
        ********* pos: 189, r: `T3JpZ2luYWwtUmVjaXBpZW50OiA8L2ZheD1ibHViYkBndW1taS5ib290PgpBY3Rpb246IGZhaWxl
      ZApEaWFnbm9zdGljLUNvZGU6IHNtdHA7IDU1MCAjNS4xLjAgQWRkcmVzcyByZWplY3RlZC4KUmVt
      b3RlLU1UQTogNTMuMjQuMjgyLjE1MA=` --
      *********== read rt0 {T3JpZ2luYWwtUmVjaXBpZW50OiA8L2ZheD1ibHViYkBndW1taS5ib290PgpBY3Rpb246IGZhaWxl
      ZApEaWFnbm9zdGljLUNvZGU6IHNtdHA7IDU1MCAjNS4xLjAgQWRkcmVzcyByZWplY3RlZC4KUmVt
      b3RlLU1UQTogNTMuMjQuMjgyLjE1MA=} - current pos: 0, current buf: 0
      *********== base64_Code `T3JpZ2luYWwtUmVjaXBpZW50OiA8L2ZheD1ibHViYkBndW1taS5ib290PgpBY3Rpb246IGZhaWxl
      ZApEaWFnbm9zdGljLUNvZGU6IHNtdHA7IDU1MCAjNS4xLjAgQWRkcmVzcyByZWplY3RlZC4KUmVt
      b3RlLU1UQTogNTMuMjQuMjgyLjE1MA=`
      *********== base64_Complete `T3JpZ2luYWwtUmVjaXBpZW50OiA8L2ZheD1ibHViYkBndW1taS5ib290PgpBY3Rpb246IGZhaWxl
      ZApEaWFnbm9zdGljLUNvZGU6IHNtdHA7IDU1MCAjNS4xLjAgQWRkcmVzcyByZWplY3RlZC4KUmVt
      b3RlLU1UQTogNTMuMjQuMjgyLjE1MA=`
      *********== base64_Complete, ret: 187
      *********== base64_Code, ret: `Original-Recipient: </[email protected]>
    Action: failed
    Diagnostic-Code: smtp; 550 #5.1.0 Address rejected.
    Remote-MTA: 53.24.282.150`
      *********== read rt0, res: `Original-Recipient: </[email protected]>
    Action: failed
    Diagnostic-Code: smtp; 550 #5.1.0 Address rejected.
    Remote-MTA: 53.24.282.150`
      *********** read rc0 3960 - current pos: 189, current buf: 189
        ********* pos: 189, r: `` --
    
      *********== drain rt0  - current pos: 0, current buf: 1
      *********== drain rt0, rest: `=`
    max size for a Tcl value (2147483647 bytes) exceeded
    </pre></code>
    How one can possibly see, the proc base64_Complete (using in transform channel rt0) calculates invalid offset (187 in opposite to 189 of the original buffer in reflected channel rc0), but full buffer is already transformed.
    
    Further investigation shows that binary decode on "empty" base64 buffer (only "=") produces a panic, with wrong got out (so segfault) within the drain-handler:
    <code><pre style="padding:10pt;">
    % binary decode base64 =
    max size for a Tcl value (2147483647 bytes) exceeded
    </pre></code>
    WiP.
    
  3. login: "sebres"
  4. mimetype: "text/x-fossil-wiki"
  5. priority changed to: "7 High"
  6. subsystem changed to: "16. Commands A-H"