swprintf return incorrect number of characters written when writing to NULL and 0 length
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Expected behavior:
int test = 5;
wchat_t* buff = NULL;
size_t strlen = swprintf(buff ,0 , L"%d", test);
In this instance I would expect strlen = 1;
-------
Actual behavior:
strlen = 184467440737095
-------
Extra Info:
apt-cache policy libc6
libc6:
Installed: 2.23-0ubuntu5
Candidate: 2.23-0ubuntu5
Version table:
*** 2.23-0ubuntu5 500
500 http://
100 /var/lib/
2.23-0ubuntu3 500
500 http://
-------
lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04