Bug 4085 - iconv has wrong signature (non const input parameter)
Summary: iconv has wrong signature (non const input parameter)
Status: RESOLVED DUPLICATE of bug 2962
Alias: None
Product: glibc
Classification: Unclassified
Component: localedata (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: GNU C Library Locale Maintainers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-21 13:22 UTC by John Darrington
Modified: 2015-01-29 13:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Darrington 2007-02-21 13:22:21 UTC
In iconv/iconv.h the definition of iconv is:
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
                     size_t *__restrict __inbytesleft,
                     char **__restrict __outbuf,
                     size_t *__restrict __outbytesleft);

which is wrong.  
The second argument should be "const char **__restrict __inbuf".  This has been
fixed for sometime now in the libiconv project
http://libiconv.cvs.sourceforge.net/*checkout*/libiconv/libiconv/include/iconv.h.in
but not in glibc, which makes it hard to write code which is correct for both.

I checked for this bug against the glibc CVS on 21 Feb 2007
Comment 1 Ulrich Drepper 2007-02-23 08:04:33 UTC

*** This bug has been marked as a duplicate of 2962 ***