From ab6bcba754c7c5d57d7b627a83614b77b64a7cf9 Mon Sep 17 00:00:00 2001 From: zhangskz Date: Mon, 5 Feb 2024 17:20:33 -0500 Subject: [PATCH] Increased the size of the error message buffer by 4x, to 511 bytes. (#15728) The previous limit of 127 was causing error messages to get truncated when long identifiers are in use. This will increase the stack usage of any code that is allocating a `upb_Status` on the stack. If we want to support smaller stacks in the future, we could change `upb_Status` to store its capacity inline, so different users can allocate error buffers with different capacity. Fixes: https://github.com/protocolbuffers/protobuf/issues/14376 PiperOrigin-RevId: 603136385 Co-authored-by: Joshua Haberman --- ruby/lib/google/protobuf/ffi/ffi.rb | 2 +- upb/base/status.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby/lib/google/protobuf/ffi/ffi.rb b/ruby/lib/google/protobuf/ffi/ffi.rb index 1858c91a7df7c..765f04c2ba7b3 100644 --- a/ruby/lib/google/protobuf/ffi/ffi.rb +++ b/ruby/lib/google/protobuf/ffi/ffi.rb @@ -21,7 +21,7 @@ class FFI Upb_Map_Begin = -1 ## Encoding Status - Upb_Status_MaxMessage = 127 + Upb_Status_MaxMessage = 511 Upb_Encode_Deterministic = 1 Upb_Encode_SkipUnknown = 2 diff --git a/upb/base/status.h b/upb/base/status.h index 5b75f880fd270..0527c2b5846ba 100644 --- a/upb/base/status.h +++ b/upb/base/status.h @@ -13,7 +13,7 @@ // Must be last. #include "upb/port/def.inc" -#define _kUpb_Status_MaxMessage 127 +#define _kUpb_Status_MaxMessage 511 typedef struct { bool ok;