Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: lib: downloader: fix issue when header is not parsed at once #20020

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

eivindj-nordic
Copy link
Contributor

Fix issue with buffer offset when header is not parsed at once. This could result in data being lost in the downloaded file.

@eivindj-nordic eivindj-nordic self-assigned this Jan 21, 2025
@eivindj-nordic eivindj-nordic requested a review from a team as a code owner January 21, 2025 13:04
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jan 21, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jan 21, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 7

Inputs:

Sources:

sdk-nrf: PR head: a65704208310689b905dec71aa75c03ac13f40bd

more details

sdk-nrf:

PR head: a65704208310689b905dec71aa75c03ac13f40bd
merge base: 1c36f9c6163f8b4f2b8d94693243b78da5465fdd
target head (main): 47c18832e293d6f3e11b91c753ce436e62a46265
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (2)
subsys
│  ├── net
│  │  ├── lib
│  │  │  ├── downloader
│  │  │  │  ├── src
│  │  │  │  │  ├── transports
│  │  │  │  │  │  │ http.c
tests
│  ├── subsys
│  │  ├── net
│  │  │  ├── lib
│  │  │  │  ├── downloader
│  │  │  │  │  ├── src
│  │  │  │  │  │  │ main.c

Outputs:

Toolchain

Version: 342151af73
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:342151af73_912848a074

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister - Skipped: Skipping Build & Test as it succeeded in a previous run: 6
  • ❌ Integration tests
    • ✅ test-fw-nrfconnect-nrf-iot_serial_lte_modem - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_samples - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_lwm2m - Skipped: Job was skipped as it succeeded in a previous run
    • ❌ test-fw-nrfconnect-nrf-iot_mosh
    • ⚠️ test-fw-nrfconnect-fw-update
    • ⚠️ test-fw-nrfconnect-nrf-iot_cloud
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

@eivindj-nordic eivindj-nordic force-pushed the downloader_buf_offset_fix branch from 62aacdc to 6e516c9 Compare January 21, 2025 14:12
@eivindj-nordic eivindj-nordic removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jan 21, 2025
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jan 21, 2025
@eivindj-nordic
Copy link
Contributor Author

eivindj-nordic commented Jan 21, 2025

Removing changelog entry as the downloader library is new for this release and there is no need to highlight fixes.

@lucasvdp
Copy link
Contributor

http.c:218 dl->cfg.buf_size should probably be buf_len I now get 1715 bytes parsed on a buf_len of 1400 bytes. This results in moving -315 bytes which crashes.

@eivindj-nordic
Copy link
Contributor Author

http.c:218 dl->cfg.buf_size should probably be buf_len I now get 1715 bytes parsed on a buf_len of 1400 bytes. This results in moving -315 bytes which crashes.

Thank you, will update!

@eivindj-nordic eivindj-nordic force-pushed the downloader_buf_offset_fix branch from 6e516c9 to 8c850ad Compare January 21, 2025 16:27
Copy link
Contributor

@kacperradoszewski kacperradoszewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@eivindj-nordic eivindj-nordic force-pushed the downloader_buf_offset_fix branch 2 times, most recently from 89a3ad5 to c713865 Compare January 22, 2025 13:02
Fix issue with buffer offset when header is not parsed at once. This
could result in data being lost in the downloaded file.

Signed-off-by: Eivind Jølsgard <[email protected]>
@eivindj-nordic eivindj-nordic force-pushed the downloader_buf_offset_fix branch from c713865 to a657042 Compare January 22, 2025 13:03
@eivindj-nordic eivindj-nordic removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jan 22, 2025
@rlubos rlubos merged commit 37698a6 into nrfconnect:main Jan 23, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants