Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 81b23a128d6705c5b15949bdaf2d80edef5bf2b9643c01b134d9d695120fd1cf
Ticket: 7079e4f91601e9c784e151e86c9d7821afdd45fe
A stack overflow vulnerability in Tcl nmakehelp.c allows code execution via a crated file
User & Date: jan.nijtmans on 2021-06-22 09:17:26
Changes

  1. assignee changed to: "jan.nijtmans"
  2. closedate changed to: "2459387.88710669"
  3. closer changed to: "jan.nijtmans"
  4. icomment:
    Well, let's analyse it.
    
    Since szBuffer is initialized with fgets(), it is guaranteed to be a NULL-terminated string. The two later while's check for "*p" and "*q" resp, so those two while-loops end - worst-case - at the final NULL-character. If 'p' points at szBuffer[0] and 'q' points at szBuffer[99], then - still - the memcpy() does not overflow. I don't see at all how this can lead to code execution.
    
    If you found this by some automatic tool, then please report this as "false alarm" to the tool maintainers.
    
    The only bug I see in this line is that 'memcpy()' should have been a 'memmove()', since p is pointing to the same buffer, it could be overlapping, which is disallowed for 'memcpy()'. That's fixed here: [28ef6c0c741408a2] (but - still - that cannot lead to code execution.
    
  5. login: "jan.nijtmans"
  6. mimetype: "text/x-fossil-wiki"
  7. resolution changed to: "Invalid"
  8. severity changed to: "Cosmetic"
  9. status changed to: "Closed"