source: fix mapStringObject clone to copy len and keys#168
Merged
flouthoc merged 5 commits intocontainers:mainfrom Jan 17, 2026
Merged
source: fix mapStringObject clone to copy len and keys#168flouthoc merged 5 commits intocontainers:mainfrom
flouthoc merged 5 commits intocontainers:mainfrom
Conversation
Member
Author
|
@flouthoc PTAL |
4673c6d to
23cb77f
Compare
23cb77f to
d5c8bfc
Compare
Member
Author
|
tests are still failing on s390x... looking into it |
The emit_clone_body() method for MapStringObjectType was generating incomplete clone functions that only copied the values array but forgot to copy the len field and the keys array. This caused cloned structures to have len=0 and NULL keys, resulting in data loss when serializing and potential memory issues. Add a test that verifies cloning of mapStringObject types (netDevices) works correctly, including proper copying of len, keys, and values. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Fix typo 'itmes' -> 'items' in the generated C code for nested byte array parsing. This would cause a compilation error if any schema used nested byte arrays. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Fix invalid C syntax 'else ()' -> 'else' in two locations where byte array generation code is emitted. This would cause compilation errors if any schema used nested byte arrays. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Add the missing emit_clone() method to BasicMapArrayHandler so that arrays of basic map types (mapStringString, mapStringInt, etc.) are properly cloned. Without this, cloning would produce incomplete results for any schema using arrays of basic maps. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Fix several issues in the nested byte array parsing code: - Add missing assignment of _len field for the array length - Fix NULL check to check the array pointer, not an element with uninitialized index variable - Use the stored _len field instead of re-reading from YAJL - Fix brace escaping for f-string compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
d5c8bfc to
5a0e037
Compare
Member
Author
fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The emit_clone_body() method for MapStringObjectType was generating incomplete clone functions that only copied the values array but forgot to copy the len field and the keys array. This caused cloned structures to have len=0 and NULL keys, resulting in data loss when serializing and potential memory issues.
Add a test that verifies cloning of mapStringObject types (netDevices) works correctly, including proper copying of len, keys, and values.