diff --git a/src/util/virerror.c b/src/util/virerror.c index 1f15c5dbbea8114feea2113177d104d221f6b0c8..91022c3b6352b5431bc9f437114b8fc10b85f6de 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1480,7 +1480,7 @@ void virReportErrorHelper(int domcode, { int save_errno = errno; va_list args; - char errorMessage[1024]; + char errorMessage[VIR_ERROR_MAX_LENGTH]; const char *virerr; if (fmt) { @@ -1541,8 +1541,8 @@ void virReportSystemErrorFull(int domcode, const char *fmt, ...) { int save_errno = errno; - char strerror_buf[1024]; - char msgDetailBuf[1024]; + char strerror_buf[VIR_ERROR_MAX_LENGTH]; + char msgDetailBuf[VIR_ERROR_MAX_LENGTH]; const char *errnoDetail = virStrerror(theerrno, strerror_buf, sizeof(strerror_buf)); diff --git a/src/util/virerror.h b/src/util/virerror.h index fba18ba5898519a37ba39983aaccf29cc62f5cf6..cf434f45fca9cbb6d8b764e5089491cbab5fca91 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -24,6 +24,8 @@ # include "internal.h" +# define VIR_ERROR_MAX_LENGTH 1024 + extern virErrorFunc virErrorHandler; extern void *virUserData;