Skip to content

Commit c02da5e

Browse files
Katsutoshi Ikenoyazwoop
authored andcommitted
Fixes some var-args missing va_start/end
This was introduced in apache#1299 But, the good news is that this has not been part of a release.
1 parent 032920f commit c02da5e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

proxy/http/HttpBodyFactory.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,14 @@ class HttpBodyFactory
166166
if (format) {
167167
// The length from ink_bvsprintf includes the trailing NUL, so adjust the final
168168
// length accordingly.
169+
va_start(ap, format);
169170
int l = ink_bvsprintf(nullptr, format, ap);
171+
va_end(ap);
170172
if (l <= max_buffer_length) {
171-
msg = (char *)ats_malloc(l);
173+
msg = (char *)ats_malloc(l);
174+
va_start(ap, format);
172175
*resulting_buffer_length = ink_bvsprintf(msg, format, ap) - 1;
176+
va_end(ap);
173177
}
174178
}
175179
return msg;

0 commit comments

Comments
 (0)