fix CVE-2014-1912
fix build issues with readline