mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 10:10:35 +08:00
MAVLink log: protect against empty field
This commit is contained in:
@@ -101,6 +101,10 @@ __EXPORT int mavlink_logbuffer_read(struct mavlink_logbuffer *lb, struct mavlink
|
||||
|
||||
__EXPORT void mavlink_logbuffer_vasprintf(struct mavlink_logbuffer *lb, int severity, const char *fmt, ...)
|
||||
{
|
||||
if (!fmt) {
|
||||
return;
|
||||
}
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int end = (lb->start + lb->count) % lb->size;
|
||||
@@ -119,6 +123,10 @@ __EXPORT void mavlink_logbuffer_vasprintf(struct mavlink_logbuffer *lb, int seve
|
||||
|
||||
__EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...)
|
||||
{
|
||||
if (!fmt) {
|
||||
return;
|
||||
}
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
char text[MAVLINK_LOG_MAXLEN + 1];
|
||||
|
||||
Reference in New Issue
Block a user