ENT-13590: Fixed heap buffer overflow in files edit_line#5993
Merged
Conversation
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
```
==25903==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x50200004460f at pc 0x7fa23c10ec86 bp 0x7ffef7339c60 sp 0x7ffef7339408
READ of size 1 at 0x50200004460f thread T0
#0 0x7fa23c10ec85 in __interceptor_strncmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:497
#1 0x7fa23be8d09b in StringSafeCompareN /tmp/matchpolicy_poc_3369/cfengine-core/libntech/libutils/string_lib.c:254
#2 0x7fa23be8d10f in StringEqualN /tmp/matchpolicy_poc_3369/cfengine-core/libntech/libutils/string_lib.c:268
cfengine#3 0x560644d90e30 in MatchPolicy /tmp/matchpolicy_poc_3369/cfengine-core/cf-agent/files_editline.c:1749
---snip---
0x50200004460f is located 1 bytes to the left of 4-byte region [0x502000044610,0x502000044614)
allocated by thread T0 here:
---snip---
```
Ticket: ENT-13590
Changelog: Title
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
|
Thank you for submitting a PR! Maybe @craigcomstock can review this? |
craigcomstock
approved these changes
Dec 15, 2025
Contributor
Author
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.
Backported to #6001