Skip to content

Commit

Permalink
Increased the size of the error message buffer by 4x, to 511 bytes.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
haberman authored and copybara-github committed Jan 31, 2024
1 parent 47e92cd commit 32a6f7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ruby/lib/google/protobuf/ffi/ffi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion upb/base/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 32a6f7a

Please sign in to comment.