Opened 14 years ago

Closed 14 years ago

#56 closed defect (invalid)

emxomfld doesn't properly allocate space for map file name

Reported by: ydario Owned by: bird
Priority: normal Milestone: libc-0.6.1
Component: emx Version: 0.6
Severity: normal Keywords:
Cc:

Description

When the output file name doesn't include the extension (this is not required for omf linkers), the map file name space allocation is shorter than needed, so a memory overwriting occurs.

Index: emxomfld.c
===================================================================
--- emxomfld.c	(revision 2508)
+++ emxomfld.c	(working copy)
@@ -1657,8 +1670,13 @@
     map_fname = "nul";
   else if (map_fname == NULL)
     {
-      t = xstrdup (output_fname);
+      //yd output file name can be without extension, need to alloc enough space
+      t = xmalloc (strlen (output_fname) + 1 + 4);
+      strcpy (t, output_fname);
       _remext (t);

Change History (1)

comment:1 Changed 14 years ago by bird

  • Resolution set to invalid
  • Status changed from new to closed

This was a fix for you own bug in #46 which wasn't committed.

Note: See TracTickets for help on using tickets.