Bug 116606

Summary: mbtowc() doesn't like large SIZE parameter values
Product: [Fedora] Fedora Reporter: Miloslav Trmac <mitr>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-08 12:31:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miloslav Trmac 2004-02-23 18:55:58 UTC
Version-Release number of selected component (if applicable):
glibc-2.3.2-101.4

Steps to Reproduce:
#include <limits.h>
#include <locale.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

int
main (void)
{
  wchar_t wc;

  setlocale (LC_CTYPE, "en_US.UTF-8");
  printf ("%d\n", mbtowc (&wc, "\xc3\xa1", MB_LEN_MAX));
  printf ("%d\n", mbtowc (&wc, "\xc3\xa1", SIZE_MAX));
  return EXIT_SUCCESS;
}

  
Actual results:
2
-1

Expected results:
2
2

Comment 1 Miloslav Trmac 2004-04-08 12:31:50 UTC
This looks fixed in glibc-2.3.3-18.

Comment 2 John Flanagan 2004-05-12 01:28:25 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-212.html