[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dragonfly-submit
Subject:    [DragonFlyBSD - Submit #2920] _ascii_wcsnrtombs, _ascii_mbsnrtowcs, and _none_wcsnrtombs neglect to 
From:       bugtracker-admin () leaf ! dragonflybsd ! org
Date:       2019-06-18 16:39:10
Message-ID: redmine.journal-13701.20190618163910.96fd5d3910124d14 () leaf ! dragonflybsd ! org
[Download RAW message or body]

Issue #2920 has been updated by liweitianux.


The patch has been committed in 2016.

----------------------------------------
Submit #2920: _ascii_wcsnrtombs, _ascii_mbsnrtowcs, and _none_wcsnrtombs neglect to \
set src on EILSEQ error http://bugs.dragonflybsd.org/issues/2920#change-13701

* Author: RockinRoel
* Status: New
* Priority: Normal
* Assignee: dragonflybsd1
* Category: 
* Target version: 
----------------------------------------
DragonFlyBSD's libc also suffers from this bug in FreeBSD and Mac OS X: \
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209907

I noticed that when using wcsrtombs, if a character is encountered that can not be \
converted, it sets errno to EILSEQ and returns (size_t)-1. However *src still points \
to the original character, even though it should point to the character after the one \
that conversion stopped at. I've attached a test program that reproduces the issue.

The expected output is:
inptr - in: 7

The actual output is:
inptr - in: 0

I've included the patch that fixes it for the none and ascii locale (it's fine for \
other locales).

---Files--------------------------------
test_wcsrtombs.c (312 Bytes)
eilseq_fix.patch (1006 Bytes)
eilseq_fix_corrected_2.patch (1.32 KB)


-- 
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic