Carlos Navarro wrote:
CN> CN>> I think that you have found the source of text corruption
CN> CN>> problems in Smapi/JamNNTPd: it may not be safe to use strcpy
CN> CN>> that way.
CN>
CN> TK> Wow..!
CN>
CN> TK> Could it be also the reason why there are no text corruption
CN> TK> problems in my OS/2 version of jamnntpd which is compiled with
CN> TK> ancient gcc3 ?
CN>
CN> I think so. I don't have those problems when compiling with MinGW
CN> for Win32, either. It seems it depends on how each compiler
CN> implements the strcpy function.
Yep. I have been wondering for a long time that compiling the exactly same code in different systems produce binaries that behave differently.
CN> This may be a possible way to fix the corrupted From field in
CN> headers: in nntpserv.c, instead of just removing this line:
CN>
CN> strcpy(mimefrom,&mimefrom[6]);
CN>
CN> Replace it by:
CN>
CN> memmove(mimefrom,mimefrom+6,strlen(mimefrom)-5);
CN>
CN> There could also be issues with the Subject field. The next line:
CN>
CN> strcpy(mimesubj,&mimesubj[9]);
CN>
CN> could be changed to:
CN>
CN> memmove(mimesubj,mimesubj+9,strlen(mimesubj)-8);
CN>
CN> As for the corruption in the body of messages posted with
CN> newsreaders that support flowed text (like Thunderbird), I think it
CN> may be fixed by changing this:
CN>
CN> strcpy(line,&line[1]);
CN>
CN> to this:
CN>
CN> memmove(line,line+1,strlen(line));
Have to try these asap! :D
'Tommi
---
* Origin: rbb.fidonet.fi - Lake Ylo - Finland (2:221/6.0)
|