Fix wpa_config_parse_string() to null terminate printf decoded values
authorKyeyoon Park <kyeyoonp@qca.qualcomm.com>
Wed, 25 Sep 2013 09:34:35 +0000 (12:34 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 25 Sep 2013 11:43:24 +0000 (14:43 +0300)
commit913c19c6e54c74b7ca061d877907bca7206a4de9
tree3f913e60e4e8be6988e31a0dcca6b88d72ca0ce5
parent04e533e24944afa9d3bbaf86b2223e184198d603
Fix wpa_config_parse_string() to null terminate printf decoded values

printf_decode() fills in a binary buffer and returns the length of
the written data. This did not use null termination since initial
use cases used the output as a binary value. However, Hotspot 2.0
cred block values are also using this for parsing strings. Those
cases could end up without proper null termination depending on what
os_malloc() ends up getting as the memory buffer. Fix these and make
printf_decode() more convenient by forcing the output buffer to be
null terminated.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
src/utils/common.c