Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <20040106001714.13201.qmail@linuxmail.org> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "peter garrone" To: cygwin AT cygwin DOT com Date: Tue, 06 Jan 2004 08:17:14 +0800 Subject: readlink null termination problem X-Originating-Ip: 192.10.200.223 X-Originating-Server: ws5-1.us4.outblaze.com I was having a problem with mkcramfs on cygwin creating symbolic links for the compressed linux filesystem. mkcramfs uses malloc to allocate a buffer that it sends to the readlink function in cygwin path.cc That function uses memcpy to do a copy of the link into a buffer. Neither mkcramfs or readlink is null-terminating the string representing the link. Probably both are at fault. I have fixed my problem by zeroing the buffer in mkcramfs before calling readlink, but it would probably be beneficial if readlink terminates the returned string, if there is room. -- ______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/