Opened 20 years ago
Closed 20 years ago
#56 closed defect (invalid)
emxomfld doesn't properly allocate space for map file name
| Reported by: | Yuri Dario | 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);
Note:
See TracTickets
for help on using tickets.

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