Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 516420bba865ad7642124590127d87e03be5b34d6ccff6f8f6a8e56cb29b3b68
Ticket: 5bbd044812bdb410016924337634b79d9892a8ff
Fix index underflow
User & Date: anonymous on 2020-05-27 13:28:55
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    From 3f0d4884b97007112100a18e4a3cb95b193a1dec Mon Sep 17 00:00:00 2001
    From: Andreas Schwab <[email protected]>
    Date: Wed, 27 May 2020 15:18:19 +0200
    Subject: [PATCH] Fix index underflow
    
    ---
     generic/tclFileName.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/generic/tclFileName.c b/generic/tclFileName.c
    index 7ff7eecae..5e7b70dbe 100644
    --- a/generic/tclFileName.c
    +++ b/generic/tclFileName.c
    @@ -2448,7 +2448,7 @@ DoGlob(
     		size_t len;
     		const char *joined = TclGetStringFromObj(joinedPtr,&len);
     
    -		if (strchr(separators, joined[len-1]) == NULL) {
    +		if (len != 0 && strchr(separators, joined[len-1]) == NULL) {
     		    Tcl_AppendToObj(joinedPtr, "/", 1);
     		}
     	    }
    @@ -2485,7 +2485,7 @@ DoGlob(
     	    size_t len;
     	    const char *joined = TclGetStringFromObj(joinedPtr,&len);
     
    -	    if (strchr(separators, joined[len-1]) == NULL) {
    +	    if (len != 0 && strchr(separators, joined[len-1]) == NULL) {
     		if (Tcl_FSGetPathType(pathPtr) != TCL_PATH_VOLUME_RELATIVE) {
     		    Tcl_AppendToObj(joinedPtr, "/", 1);
     		}
    -- 
    2.26.2
    
  5. foundin changed to: "any"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "anonymous"
  13. subsystem changed to: "16. Commands A-H"
  14. title changed to: "Fix index underflow"
  15. type changed to: "Bug"