TIP: Click on subject to list as thread! ANSI
echo: makenl_ng
to: Andrew Leary
from: Wilfred van Velzen
date: 2016-12-02 13:11:10
subject: Re: MakeNL 3.4.6 Release

Hi Andrew,

On 2016-12-01 22:20:27, Andrew Leary wrote to All:
  about: "MakeNL 3.4.6 Release":

 AL> MakeNL 3.4.6 has been released and hatched into the COORDUTL fileecho.

I noticed the following in the output.c file:

+        if (RemoveBOM)
+        {
+            templine = linebegin;
+            templine = strstr(linebegin, "\xef\xbb\xbf");
+            if (templine != NULL) /* BOM found on line */
+            {
+                templn2 = templine + 3; /* Move rest of line over BOM */
+                strcpy(templine, templn2);
+            }
+        }

Your using strcpy to copy overlapping strings. The behaviour of strcpy when
source and destination overlap is undefined for all definitions of strcpy I
know. So it might work, or it might not, for all permutations of compilers,
os's and compiler options, that makenl is compiled on.

I suggest:

                 memmove(templine, templn2, strlen(templn2) + 1);


The same is true for the fts5.c file, with about the same code...


Bye, Wilfred.


--- FMail-W32 1.73.8.50-B20161201
* Origin: Native IPv6 connectable node (2:280/464)
SEEN-BY: 3/50 154/10 203/0 227/51 230/0 240/5832 249/303 261/38 280/464 5003
SEEN-BY: 280/5555 292/624 854 340/200 423/120 633/267 280 712/620 848 770/1
SEEN-BY: 2320/100
@PATH: 280/464 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.