Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bce025f6494ac205891bf1556dbe973768dbe4b6
Ticket: 965a39e3140dfbd1b1c443990fe47842e9d20ec5
crash during read from binary channel
User & Date: anonymous on 2014-01-02 16:06:43
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Hi All,
    
    from time to time I am facing a crash during read in tcl. I think the problem is in tclIO.c (see patch below). The new calculated length will be to small by 1 in case offset == toRead. The problem can be easily fixed by changing the if statement as shown below.
    
    BR
    René
    
    --- ./generic/tclIO.c.orig      2014-01-02 16:40:20.399912000 +0100
    +++ ./generic/tclIO.c   2014-01-02 16:40:53.290141000 +0100
    @@ -5595,7 +5595,7 @@
             */
    
            length = offset * 2;
    -       if (offset < toRead) {
    +       if (offset <= toRead) {
                length = offset + toRead + 1;
            }
            dst = (char *) Tcl_SetByteArrayLength(objPtr, length);
    
  5. foundin changed to: "8.6.1 and 8.5.x"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "e2564b59ce1ba8531a0d02236c62639a6cc2b66f"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "18. Commands M-Z"
  15. title changed to: "crash during read from binary channel"
  16. type changed to: "Bug"