Skip to content

Commit ab6bcba

Browse files
zhangskzhaberman
andauthored
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: #14376 PiperOrigin-RevId: 603136385 Co-authored-by: Joshua Haberman <[email protected]>
1 parent 3e99024 commit ab6bcba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ruby/lib/google/protobuf/ffi/ffi.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class FFI
2121
Upb_Map_Begin = -1
2222

2323
## Encoding Status
24-
Upb_Status_MaxMessage = 127
24+
Upb_Status_MaxMessage = 511
2525
Upb_Encode_Deterministic = 1
2626
Upb_Encode_SkipUnknown = 2
2727

upb/base/status.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Must be last.
1414
#include "upb/port/def.inc"
1515

16-
#define _kUpb_Status_MaxMessage 127
16+
#define _kUpb_Status_MaxMessage 511
1717

1818
typedef struct {
1919
bool ok;

0 commit comments

Comments
 (0)