Eric Auer wrote:

    >Hi, I have 2 bugs in EDIT but need an idea how to fix... maybe
    >you can hunt them down? Thanks!
    >
    >1. EDIT crashes when trying to expand tabs (it asks you before
    >   doing so, so if you think it will chrash you can still say no
before...
    >

In edit.c, line 473 (tab expansion) is:

strcpy(Buf+recptr+i+j, Buf+recptr+i+1);

In this line you are using strcpy to move overlapping strings.
However, you cannot know what direction strcpy uses (up or down).
Therefore strcpy should never be used for copying overlapping objects.
Use memmove instead:

memmove(Buf+recptr+i+j, Buf+recptr+i+1,rmax-i);

Even strncpy (which I always prefer over strcpy, since it is safer)
cannot be used here.

Hope this helps.

Christof









-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Freedos-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to