History log of /openbmc/libbej/src/ (Results 1 – 25 of 35)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
8c4332a515-Jul-2025 Kasun Athukorala <kasunath@google.com>

Verify dictionary property name length

This change verifies the dictionary property name length.

Tested:
Unit tested

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I65f19d5bb1b8c

Verify dictionary property name length

This change verifies the dictionary property name length.

Tested:
Unit tested

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I65f19d5bb1b8c9f838e427fd6d8ba17e2886bf9a

show more ...

7c1be8dd15-Jul-2025 Kasun Athukorala <kasunath@google.com>

Check dictionary sizes to avoid any heap overflows

Tested:
Unit tested

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I34972b7f4daf0e818461ef2a4842966a247fc20e

6fd03fbf15-Jul-2025 Kasun Athukorala <kasunath@google.com>

Check SFLV tuple is within stream before decoding

If the SFLV tuple being decoded goes out of the stream length
it could lead to a heap overflow. This patch adds a check to
prevent it.

Tested:
Unit

Check SFLV tuple is within stream before decoding

If the SFLV tuple being decoded goes out of the stream length
it could lead to a heap overflow. This patch adds a check to
prevent it.

Tested:
Unit tested

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: Ie018d4f3614603efc6ed8b93fa0077c612d9b481

show more ...

485044b114-Jul-2025 Kasun Athukorala <kasunath@google.com>

bej_decoder: Check decoded string length

We need to check the bejString value lengths to prevent heap
buffer overflow

Tested:
Unit tested

Change-Id: Ie6a014fbffeb31f111bfbae331db197b3fb2f2ca
Signe

bej_decoder: Check decoded string length

We need to check the bejString value lengths to prevent heap
buffer overflow

Tested:
Unit tested

Change-Id: Ie6a014fbffeb31f111bfbae331db197b3fb2f2ca
Signed-off-by: Kasun Athukorala <kasunath@google.com>

show more ...

9eb0117f23-Jun-2025 Brandon Kim <brandonkim@google.com>

bej_decoder_json: Add a limit on # of 0s in "real"

We have count the number of 0s in real numbers to add to the output
string. To prevent OOM from many 0s, add a limit.

Tested: Add unit test

Chang

bej_decoder_json: Add a limit on # of 0s in "real"

We have count the number of 0s in real numbers to add to the output
string. To prevent OOM from many 0s, add a limit.

Tested: Add unit test

Change-Id: I5e298554cf9d93b3f7ab86cac5b0b0a6f443716b
Signed-off-by: Brandon Kim <brandonkim@google.com>

show more ...

ef01d4c523-Jun-2025 Brandon Kim <brandonkim@google.com>

bej: Fix typo for enum "bejErrorNotSuppoted"

The enum had a typo as "bejErrorNotSuppoted" with missing 'r'. Replace
with "bejErrorNotSupported"

Tested: N/A

Change-Id: Ieced19f88757caeb555dbdad817a

bej: Fix typo for enum "bejErrorNotSuppoted"

The enum had a typo as "bejErrorNotSuppoted" with missing 'r'. Replace
with "bejErrorNotSupported"

Tested: N/A

Change-Id: Ieced19f88757caeb555dbdad817ab2fbbbe8ce8d
Signed-off-by: Brandon Kim <brandonkim@google.com>

show more ...

07abbf8923-Jun-2025 Brandon Kim <brandonkim@google.com>

bej_decoder: Add a limit on number of operations

This is to prevent the decoder from taking on a huge number of
operations from a single input, that could cause the main while loop for
bejDecode to

bej_decoder: Add a limit on number of operations

This is to prevent the decoder from taking on a huge number of
operations from a single input, that could cause the main while loop for
bejDecode to run for a long time.

Tested: Unit test passes

Change-Id: Idb68b706d3634d1874d1814f17420076672d21ee
Signed-off-by: Brandon Kim <brandonkim@google.com>

show more ...

c3ab417101-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

meson: reformat with meson formatter

Apply the `meson format` results.

Change-Id: I310cd74890fc18c36958a11fcb544413a809ed01
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

045a2d6501-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: Ibfcb2a3a7ae4312abe2cc727ef7b702758c5757e
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: Ibfcb2a3a7ae4312abe2cc727ef7b702758c5757e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

716c741d19-Dec-2024 Jayanth Othayoth <ojayanth@gmail.com>

clang-tidy: Add prototype to function declarations

Replaced function declarations without prototypes with proper
prototypes to comply with modern C standards and resolve
deprecation warnings.

'''
e

clang-tidy: Add prototype to function declarations

Replaced function declarations without prototypes with proper
prototypes to comply with modern C standards and resolve
deprecation warnings.

'''
error: a function declaration without a prototype is deprecated in all versions of C [clang-diagnostic-strict-prototypes]
'''

Tested: Build verified

Change-Id: Ia85ad603623aa64e157dd7550d8023e6861d9201
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>

show more ...

a46f985027-Sep-2024 Brian Ma <chma0@nuvoton.com>

bej_tree: initialize node attribute format

While initializing the parent and child nodes, initialize the reserved
bit of the node attribute format to prevent unexpected reserved bit
setting.

And al

bej_tree: initialize node attribute format

While initializing the parent and child nodes, initialize the reserved
bit of the node attribute format to prevent unexpected reserved bit
setting.

And also override gtest's PrintTo function to avoid accessing
uninitialized areas due to structure alignment.

Tested:
Run test cases pass

Change-Id: I5b113f47c41ad15de578b80bf5e859f3b0c40503
Signed-off-by: Brian Ma <chma0@nuvoton.com>

show more ...

be27f2e916-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I133f4f43d4955ba1b86b924fc741aa5a56f34239
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

da6e557313-Mar-2023 Nikhil Namjoshi <nikhilnamjoshi@google.com>

Add libbej encoder wrapper for C++

Add unit tests and the test data files needed for unit tests.
Move APIs from bej_decoder_test.cpp to a common file, to share those
with bej_encoder_test.cpp

Teste

Add libbej encoder wrapper for C++

Add unit tests and the test data files needed for unit tests.
Move APIs from bej_decoder_test.cpp to a common file, to share those
with bej_encoder_test.cpp

Tested:
Verified that encoding using the wrapper works well at runtime.
Verified that the unit tests pass.

Change-Id: I61b7c17690eb7e7fefd1973a22d4316c6214267e
Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>

show more ...

6df0c48618-Aug-2023 kasunath <kasunath@google.com>

Encode more BEJ data types

This patch add encoding support for bejString, bejReal, bejBool and
bejPropertyAnnotation types.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I5c7dc30

Encode more BEJ data types

This patch add encoding support for bejString, bejReal, bejBool and
bejPropertyAnnotation types.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I5c7dc302dfd4e374f792f2eee643f4adaac7e1f9

show more ...

0a29193f18-Aug-2023 kasunath <kasunath@google.com>

Encode bejArray, bejNull, bejInteger and bejEnum

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I2b851be69b51fe95a14287d1ca5f94ffcf757d0f

bde1bfa118-Aug-2023 kasunath <kasunath@google.com>

Get metadata for bejNull type

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I08d0c8f26e1ed64f67cfcf857fbdd8573dae75d4

de02e7da18-Aug-2023 kasunath <kasunath@google.com>

Get metadata for bejReal type

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: Ib5de2d4fde4a129cb32988268c3289ba06572b16

b250dd5401-Aug-2023 kasunath <kasunath@google.com>

Get metadata for bejEnum type

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I6c135c8ff67952efa59143a37e60020cf8a1f492

061fbc6f01-Aug-2023 kasunath <kasunath@google.com>

Get metadata for BEJ integer, string and bool

This change adds the support to derive bejInteger, bejString and
bejBool node metadata.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id

Get metadata for BEJ integer, string and bool

This change adds the support to derive bejInteger, bejString and
bejBool node metadata.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: Ib6efcd29bf7cb2acc9913f95756e60ee65f16c6d

show more ...

f68be95901-Aug-2023 kasunath <kasunath@google.com>

Initialize a parent node metadata

This adds the support needed to initialize a parent node metadata
properties.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: Ibb90665064904cc7fe1

Initialize a parent node metadata

This adds the support needed to initialize a parent node metadata
properties.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: Ibb90665064904cc7fe1bde6dd5590545592f7d41

show more ...

99bd6c9030-Jul-2023 kasunath <kasunath@google.com>

Add the framework needed for BEJ encoding

This change adds the framework needed for BEJ encoding. Inorder to keep
the patch smaller, I only added the basic framework needed to understand
how the enc

Add the framework needed for BEJ encoding

This change adds the framework needed for BEJ encoding. Inorder to keep
the patch smaller, I only added the basic framework needed to understand
how the encoding is done. Rest of the functionality and testing will
be added in the later patches.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: If2bd315fe5a3e6c7afff2af1750434042517790b

show more ...

dc3f214b31-Jan-2023 kasunath <kasunath@google.com>

Add more support to bej_tree API

This change adds bejString, bejReal and bejBoolean node types,
and also 2 new APIs, UpdateNodeFlags() and IsParentType().

Signed-off-by: Kasun Athukorala <kasunath@

Add more support to bej_tree API

This change adds bejString, bejReal and bejBoolean node types,
and also 2 new APIs, UpdateNodeFlags() and IsParentType().

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I94d36a63dd95893acd3517d30790c8fe71917989

show more ...

2ebe82f531-Jan-2023 kasunath <kasunath@google.com>

Add BEJ tree API.

This API allows us to represent a JSON object with a linked list
representation.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I7894e7c10e4db2ad02a79b01bb4d7a48

Add BEJ tree API.

This API allows us to represent a JSON object with a linked list
representation.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: I7894e7c10e4db2ad02a79b01bb4d7a48d5a197cd

show more ...

435526a510-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I1ae768f5bd68d4eec70acab9964c43370423bf5e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

c14fab6e23-Nov-2022 kasunath <kasunath@google.com>

Fix missing comma for empty arrays/sets

When an array or a set is empty, and if it's not the last property
within an object, we need to add a comma after empty brackets/braces.

This change fix this

Fix missing comma for empty arrays/sets

When an array or a set is empty, and if it's not the last property
within an object, we need to add a comma after empty brackets/braces.

This change fix this issue. Also updated a test case to capture this.

Signed-off-by: Kasun Athukorala <kasunath@google.com>
Change-Id: Ia087f341d052660191f2614add2060c81be67f61

show more ...

12