Skip to content

Conversation

@larsewi
Copy link
Contributor

@larsewi larsewi commented Dec 11, 2025

  • files_editline.c: removed trailing whitespace
  • Fixed heap buffer overflow in files edit_line

Backported to #6001

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>
@cf-bottom
Copy link

Thank you for submitting a PR! Maybe @craigcomstock can review this?

@larsewi larsewi added the cherry-pick? Fixes which may need to be cherry-picked to LTS branches label Dec 15, 2025
@larsewi larsewi removed the cherry-pick? Fixes which may need to be cherry-picked to LTS branches label Dec 15, 2025
@cfengine cfengine deleted a comment from cf-bottom Dec 16, 2025
@larsewi
Copy link
Contributor Author

larsewi commented Dec 17, 2025

Build Status

@larsewi larsewi merged commit 8015f59 into cfengine:master Dec 19, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants