svn: /pecl/translit/trunk/data/ compact_underscores.c
| From: | Derick Rethans | Date: | Mon, 11 Nov 2013 10:59:55 +0000 |
| Subject: | svn: /pecl/translit/trunk/data/ compact_underscores.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-19981@lists.php.net to get a copy of this message | ||
derick Mon, 11 Nov 2013 10:59:55 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=332106
Log:
- Fixed bug #58461: compact_underscores_convert segfaults with 0 length string.
(Patch by David Sklar)
Bug: https://bugs.php.net/58461 (Open)
compact_underscores_convert segfaults with 0 length string
Changed paths:
U pecl/translit/trunk/data/compact_underscores.c
Modified: pecl/translit/trunk/data/compact_underscores.c
===================================================================
--- pecl/translit/trunk/data/compact_underscores.c 2013-11-10 10:42:59 UTC (rev 332105)
+++ pecl/translit/trunk/data/compact_underscores.c 2013-11-11 10:59:55 UTC (rev 332106)
@@ -33,7 +33,7 @@
count = 0;
}
}
- while (tmp_out[out_idx - 1] == (unsigned short) '_') {
+ while ((out_idx > 0) && tmp_out[out_idx - 1] == (unsigned short) '_') {
out_idx--;
}
*out_length = out_idx;