From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5763 invoked by alias); 25 Jun 2008 13:04:05 -0000 Received: (qmail 5457 invoked by uid 48); 25 Jun 2008 13:03:22 -0000 Date: Wed, 25 Jun 2008 13:04:00 -0000 Message-ID: <20080625130322.5456.qmail@sourceware.org> From: "halesh dot sadashiv at ap dot sony dot com" To: glibc-bugs@sources.redhat.com In-Reply-To: <20080618130922.6654.john@calva.com> References: <20080618130922.6654.john@calva.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/6654] realpath contains off-by-one errors X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00060.txt.bz2 ------- Additional Comments From halesh dot sadashiv at ap dot sony dot com 2008-06-25 13:03 ------- Created an attachment (id=2795) --> (http://sourceware.org/bugzilla/attachment.cgi?id=2795&action=view) Testcase to verify the problem in __realpath() Hi, Even though the raised defect occurs in realtime hardly, I have tried to prove with small testcode. By executing the attached testcase I found the o/p like this $ ./test_realpath Softlinked file before calling realpath: lfile Actual_path got from realpath /home/halesh/simple.exp.t Softlinked file after calling realpath: After calling the realpath() API, the varibale which had softlink file name will get currupted because of overwriting '\0' in __realpath() of stdlib/canonicalize.c char* __realpath (const char *name, char *resolved) { [...] n = __readlink (rpath, buf, path_max); if (n < 0) goto error; buf[n] = '\0'; [...] } After applaying the patch..the o/p was proper $ ./test_realpath Softlinked file before calling realpath: lfile Actual_path got from realpath /home/halesh/simple.exp. Softlinked file after calling realpath: lfile If any comments please let me know. -- http://sourceware.org/bugzilla/show_bug.cgi?id=6654 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.