FLTK logo

STR #263

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]

STR #263

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:4 - High, e.g. key functionality not working
Scope:2 - Specific to an operating system
Subsystem:WIN32
Summary:scandir win32 bug memory overrun
Version:1.1.4
Created By:fabien.onepost
Assigned To:mike
Fix Version:1.1.5rc1
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 fabien.onepost
06:14 Jan 27, 2004
SYMPTOM:
  memory overrun char array written beyond its size.

SOLUTION:
  In file: scandir_win32.c
  replace->   selectDir=(struct dirent*)malloc(sizeof(struct
dirent)+strlen(find.cFileName)+1);
  by       ->   selectDir=(struct dirent*)malloc(sizeof(struct
dirent)+strlen(find.cFileName)+2);

EXPLAIN:
This happens when then following condition is met:
    if (find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
      // Append a trailing slash to directory names...
      strcat(selectDir->d_name, "/");

because we concatenate a slash we need one more char ....
 
 
#2 mike
19:02 Feb 25, 2004
Fixed in CVS - the anonymous CVS repository will be updated at midnight PST.  
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.