Date: Sun, 15 Mar 1998 19:27:05 +0200 (IST) From: Eli Zaretskii To: Martin Stromberg cc: djgpp-workers AT delorie DOT com Subject: Re: Where to get the latest sources for djtar In-Reply-To: <199803151700.SAA03133@propus.lu.erisoft.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk Note that I have removed the DJGPP list from the addresses. Patches should be sent to DJ Delorie and to the djgpp-workers list . On Sun, 15 Mar 1998, Martin Stromberg wrote: > r = mkdir (n, 0777); > if (r) > + { > + if(errno == ENOENT) > + { > + Fatal("Unable to create directory"); > + } > r = change(n, "Unable to create directory", 1); > + } This doesn't seem right. If we want to protect djtar from stack overrun, lets' just look out for the length of the name to be more than PATH_MAX and abort with a specific message. If you are solving here a problem other than the stack overrun, then what is the problem, exactly? Testing for ENOENT is likely to backfire, as DOS makes libc functions generate ENOENT in too many cases.