Commit 51f018c
Fix varargs usage
Coverity found a number of 'missing varargs init or cleanup' issues in
the _print() method. While examing these I found another potential
issue in the vasprintf() code, which is used only for WIN32 platforms.
Our target is Linux, and so that change is not tested.
The fix for _print() is to call vasprintf() directly without using a
loop. The contents of cli->buffer (if any) will be freed before
updating cli->buffer and cli->buf_size with the new string results,
otherwise they are unchanged. The fix for WIN32 only vasprintf() is
to wrap the first call to vsnprintf() with a va_copy()/va_end() to
preserve the passed in va_list.1 parent c223261 commit 51f018c
1 file changed
Lines changed: 12 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
2006 | 2010 | | |
2007 | 2011 | | |
2008 | 2012 | | |
2009 | | - | |
2010 | 2013 | | |
2011 | | - | |
| 2014 | + | |
2012 | 2015 | | |
2013 | 2016 | | |
2014 | 2017 | | |
2015 | | - | |
2016 | | - | |
2017 | | - | |
2018 | | - | |
2019 | | - | |
2020 | | - | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
2024 | | - | |
2025 | | - | |
2026 | | - | |
2027 | | - | |
2028 | | - | |
2029 | | - | |
2030 | | - | |
2031 | | - | |
2032 | | - | |
2033 | | - | |
2034 | | - | |
2035 | | - | |
2036 | | - | |
2037 | | - | |
2038 | | - | |
2039 | | - | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
2040 | 2023 | | |
2041 | 2024 | | |
2042 | 2025 | | |
| |||
0 commit comments