From c90d7dd86e982f0dee0f4f21cb97ba1ab2281086 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 28 Dec 2015 08:44:40 +1100 Subject: [PATCH] AP_HAL: fixed vprintf segfault --- libraries/AP_HAL/utility/print_vprintf.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL/utility/print_vprintf.cpp b/libraries/AP_HAL/utility/print_vprintf.cpp index 0353719053..742fd140a3 100644 --- a/libraries/AP_HAL/utility/print_vprintf.cpp +++ b/libraries/AP_HAL/utility/print_vprintf.cpp @@ -364,10 +364,14 @@ flt_oper: pnt = (char *)buf; size = 1; break; + case 's': pnt = va_arg (ap, char *); size = strnlen (pnt, (flags & FL_PREC) ? prec : ~0); break; + + default: + goto non_string; } if (!(flags & FL_LPAD)) { @@ -385,6 +389,8 @@ flt_oper: goto tail; } + non_string: + /* * Handle integer formats variations for d/i, u, o, p, x, X. */