[DragonFlyBSD - Bug #2265] mbsrtowcs does not properly handle invalid mbstate_t in ps

Sascha Wildner via Redmine bugtracker-admin at leaf.dragonflybsd.org
Tue Jan 10 19:56:50 PST 2012

Issue #2265 has been updated by Sascha Wildner.

Assignee set to Sascha Wildner

I have a mbsrtowcs() test somewhere I think. I will check it out.

Bug #2265: mbsrtowcs does not properly handle invalid mbstate_t in ps

Author: Chris Turner
Status: New
Priority: Normal
Assignee: Sascha Wildner
Target version: 

Was attempting to fix the lang/racket port and discovered a coredump in the autoconf tests - 

this coredumps (-HEAD from ~1mo ago / i386 / gcc44):

  #include <wchar.h>
   int main() {
    mbstate_t state;
    char *src = "X";
    mbsrtowcs(0, &src, 0, &state);
     return 0;

whereas this (or passing NULL instead of &state), does not:

  #include <wchar.h>
  #include <strings.h>
   int main() {
    mbstate_t state;
    bzero(&state, sizeof(mbstate_t));
    char *src = "X";
    mbsrtowcs(0, &src, 0, &state);
     return 0;

As I understand it - posix specifies that this should EINVAL as 
it is an 'invalid conversion state' 


that being said, I'm not particularly versed in these routines, in which
case, the test case is likely bad, or perhaps this is unspecified in posix.

comments welcome in reguards to these various factors.

I seem to recall some murmurings about updating citrus at some point -
perhaps this issue is resolved upstream there / could be tackled then.

for now, I'll be hacking the configure script and proceeding with the pkg


- Chris

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

More information about the Bugs mailing list