diff --git a/src/core/support/log_posix.c b/src/core/support/log_posix.c
index 8f85791466db369f32e5ffa98f03da986f067791..afca792c404b4158478f1a4e2c89382900afca60 100644
--- a/src/core/support/log_posix.c
+++ b/src/core/support/log_posix.c
@@ -64,7 +64,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity,
   } else {
     message = allocated = gpr_malloc(ret + 1);
     va_start(args, format);
-    vsnprintf(message, ret, format, args);
+    vsnprintf(message, ret + 1, format, args);
     va_end(args);
   }
   gpr_log_message(file, line, severity, message);