Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ bin_PROGRAMS = XconfHttpDl
AM_CPPFLAGS = -I$(top_srcdir)/hal/include
AM_CFLAGS = $(AM_CPPFLAGS)
AM_LDFLAGS = -lccsp_common
AM_LDFLAGS += -lcm_mgnt -lsysevent -lsyscfg
AM_LDFLAGS += -lcm_mgnt -lsysevent -lsyscfg -lfw_download_chk
XconfHttpDl_SOURCES = cm_http_dl.c
Comment on lines 23 to 25
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Linking against -lfw_download_chk adds a new library dependency, but configure.ac/native-build dependency config doesn’t appear to check for or build/install this library. This can cause link failures in CI or for developers without that library preinstalled; add a configure-time check (or ensure the native-build dependency scripts install it) so the build fails clearly when missing.

Copilot uses AI. Check for mistakes.

9 changes: 7 additions & 2 deletions source/cm_http_dl.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 2 in source/cm_http_dl.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/cm_http_dl.c' (Match: rdkb/components/opensource/ccsp/Xconf/rdkb/components/opensource/ccsp/Xconf/1, 728 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/Xconf/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/cm_http_dl.c)
* following copyright and licenses apply:
*
* Copyright 2017 RDK Management
Expand All @@ -21,6 +21,7 @@
#include <string.h>

#include <telemetry_busmessage_sender.h>
#include "fw_download_check.h"
#include <syscfg/syscfg.h>
Comment on lines 23 to 25
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

#include "fw_download_check.h" introduces a new external header dependency, but this repository’s native-build dependency setup (e.g., cov_docker_script/component_config.json) doesn’t appear to install/provide it. If this header isn’t in the toolchain’s default include paths, CI/native builds will fail; consider adding the appropriate include path/dependency so the header is available in all build environments.

Copilot uses AI. Check for mistakes.

#include "cm_hal.h"
Expand Down Expand Up @@ -636,8 +637,12 @@
}
else if (type == HTTP_DOWNLOAD)
{
http_status = HTTP_Download();

if(can_proceed_fw_download() == FW_DWNLD_MEMCHK_NOT_ENOUGH_MEM){
printf("Available memory is not enough to proceed with firmware download\n");
Comment on lines +640 to +641
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

can_proceed_fw_download() and FW_DWNLD_MEMCHK_NOT_ENOUGH_MEM are introduced here but no corresponding header is included in this file. Please include the header that declares this API (rather than relying on implicit declarations or transitive includes), otherwise this may fail to compile under C99+ / -Werror builds.

Copilot uses AI. Check for mistakes.
}else{
http_status = HTTP_Download();
}

Comment on lines +642 to +645
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

In the "not enough memory" path, http_status is never assigned but is still read immediately afterward to decide ret_code (if (http_status == 200)). This can yield undefined behavior and may incorrectly return success even though the download was skipped. Set ret_code (and/or http_status) explicitly when memory is insufficient, or early-return from this branch.

Suggested change
}else{
http_status = HTTP_Download();
}
/* Treat insufficient memory as a failed download */
http_status = 0;
}else{
http_status = HTTP_Download();
}

Copilot uses AI. Check for mistakes.
// The return code is after RETRY_HTTP_DOWNLOAD_LIMIT has been reached
// For 200, return SUCCESS, else FAILURE and retry in the next window
if(http_status == 200)
Expand Down
Loading