DragonFly BSD
DragonFly bugs List (threaded) for 2012-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Sascha Wildner via Redmine <bugtracker-admin@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jan 2012 19:56:50 -0800

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
http://bugs.dragonflybsd.org/issues/2265

Author: Chris Turner
Status: New
Priority: Normal
Assignee: Sascha Wildner
Category: 
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' 

http://pubs.opengroup.org/onlinepubs/009604599/functions/mbsrtowcs.html

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

Cheers,

- 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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]