From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Bug in filelock.c Date: Sat, 23 Feb 2013 21:07:09 +0200 Message-ID: <83zjyukfxe.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1361646497 17316 80.91.229.3 (23 Feb 2013 19:08:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Feb 2013 19:08:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 23 20:08:40 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U9KSd-0007Xy-H8 for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2013 20:08:39 +0100 Original-Received: from localhost ([::1]:46265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9KSI-0002zC-Al for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2013 14:08:18 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9KSA-0002yI-L8 for emacs-devel@gnu.org; Sat, 23 Feb 2013 14:08:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9KS7-0003Vk-Ad for emacs-devel@gnu.org; Sat, 23 Feb 2013 14:08:10 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:53523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9KS7-0003VY-2T for emacs-devel@gnu.org; Sat, 23 Feb 2013 14:08:07 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MIO00600T3E2K00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 23 Feb 2013 21:07:22 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MIO005YUT49V750@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 23 Feb 2013 21:07:21 +0200 (IST) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157279 Archived-At: The marked line from filelock.c seems to have such a glaring bug that I'm questioning my own judgment: /* Shift the nondirectory part of the file name (including the null) right two characters. Here is one of the places where we'd have to do something to support 14-character-max file names. */ for (p = lockfile + length; p != lockfile && *p != '/'; p--) p[2] = *p; /* Insert the `.#'. */ p[1] = '.'; p[2] = '#'; p = p + length + 2; ^^^^^^^^^^^^^^^^^^ I think it should say this instead: p = lockfile + length + 2 I guess no one ever had a situation where a numeric tail was needed, because then fill_in_lock_file_name would corrupt the stack. Or maybe on most machines nowadays arguments are not passed on the stack, even in a non-optimized build. Am I missing something?