Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 5 Aug 2014 13:35:27 -0700
From: Alon Zakai <alonzakai@...il.com>
To: musl@...ts.openwall.com
Subject: Bug report on iswalpha

I think we have encountered a bug in iswalpha, as shown by the following
program:

====
#include <locale.h>
#include <stdio.h>
#include <wctype.h>

int
main(const int argc, const char * const * const argv)
{
  const char * const locale = (argc > 1 ? argv[1] : "C");
  const char * const actual = setlocale(LC_ALL, locale);
  if(actual == NULL) {
    printf("%s locale not supported; skipped locale-dependent code\n",
           locale);
    return 0;
  }
  printf("locale set to %s: %s\n", locale, actual);

  const int result = iswalpha(0xf4); // รด
  printf("iswalpha(\"\xc3\xb4\") = %d\n", result);
  return 0;
}
====

It returns 1 in the final printf, saying that that char is an walpha char,
when I believe it is not. For comparison, glibc reports 0.

Tested on musl 1.0.3 (used in emscripten) and musl trunk on git, same
result.

- Alon

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.