[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-indent] Fixed: Bug#206785: indent segfaults on the attached file
From: |
Erik de Castro Lopo |
Subject: |
[Bug-indent] Fixed: Bug#206785: indent segfaults on the attached file |
Date: |
Tue, 23 Sep 2003 22:17:34 +1000 |
HI all,
I love it when they are this easy :-).
Basically, the code did have checking for the end of the buffer in a few
places, but did not have it inside an inner loop. This patch fixes that.
diff -r -c indent-2.2.9/src/indent.c indent-2.2.9-fix-segfault/src/indent.c
*** indent-2.2.9/src/indent.c Tue Oct 29 07:00:56 2002
--- indent-2.2.9-fix-segfault/src/indent.c Tue Sep 23 22:04:24 2003
***************
*** 875,880 ****
--- 875,882 ----
* imply we are in a stmt */
for (t_ptr = s_code; *t_ptr; ++t_ptr)
{
+ if (e_lab >= l_lab)
+ check_lab_size ();
*e_lab++ = *t_ptr; /* turn everything so far into a label */
}
After the application of the above patch, the regression test still passes.
I'll have a look at the bug I submitted tomorrow and see if I can fix that
as well. In addition I have two patches almost ready implementing two new
commands "space-before-semicolon" and "indent-closing-brace". I will get
these working tested and documented before passing them on.
Cheers,
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo address@hidden (Yes it's valid)
+-----------------------------------------------------------+
"There are two ways of constructing a software design. One way is
to make it so simple that there are obviously no deficiencies
and the other is to make it so complicated that there are no
obvious deficiencies." -- C A R Hoare
- [Bug-indent] Fixed: Bug#206785: indent segfaults on the attached file,
Erik de Castro Lopo <=