all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug in filelock.c
@ 2013-02-23 19:07 Eli Zaretskii
  2013-02-23 19:39 ` Paul Eggert
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2013-02-23 19:07 UTC (permalink / raw
  To: emacs-devel

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?



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-02-24  7:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-23 19:07 Bug in filelock.c Eli Zaretskii
2013-02-23 19:39 ` Paul Eggert
2013-02-23 20:23   ` Eli Zaretskii
2013-02-23 21:59   ` Andreas Schwab
2013-02-24  0:25     ` Paul Eggert
2013-02-24  3:46       ` Eli Zaretskii
2013-02-24  7:30         ` Paul Eggert

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.