iconv_open() currently crashes on too long codepage arguments, leading to potential DoS security problems for various applications. See for example http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-4783.
Created attachment 2011 [details] Proposed patch Proposed patch. It might be good idea to make the max length of codepage name public for the applications; I've chosen the name BSD uses for that #define.
You mean if you use more than RLIMIT_STACK long argument? If yes, glibc for this has __libc_use_alloca () check, so that it can use malloc for very large requests.
But does it make sense to use that instead of simple size check? It avoids an arbitrary limit, but all of these strings ought to be short (maybe the limit should be 128 instead of 64, just to be safe) and the code in iconvopen() would get much uglier with basically useless malloc() casing.
I changed the code in cvs.