Bug#636286: eglibc: SIGSEGV in strcoll in UTF-8 locales with certain characters
Andreas Schwab dixit:
>There is no testcase.
Meh, you know that when you say attach but forget to actually do it?
Thanks for spotting. Here it is.
bye,
//mirabilos
--
Support mksh as /bin/sh and RoQA dash NOW!
‣ src:bash (254 (273) bugs: 1 RC, 175 (190) I&N, 78 (82) M&W, 0 F&P)
‣ src:dash (82 (90) bugs: 3 RC, 44 (47) I&N, 35 (40) M&W, 0 F&P)
‣ src:mksh (2 bugs: 0 RC, 0 I&N, 2 M&W, 0 F&P)
#include <err.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
const char s1[] = { 0x20, 0xe0, 0xa6, 0xac, 0x00 };
const char s2[] = { 0x20, 0xe0, 0xa6, 0xad, 0x00 };
int
main(void)
{
int r;
if (setlocale(LC_ALL, "") == NULL)
err(4, "setlocale");
r = strcoll(s1, s2);
return (r < 0 ? 1 : r == 0 ? 2 : 3);
}
Reply to: