mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-01-28 03:37:17 +01:00
base-files: fix offset conversion on caldata_patch_data()
`$(( ))` will convert uninitialized variable to "0". If we want to use "-n" to check the string length, it's necessary to make sure the converted variable is not empty. Fixes:652a6677d5("base-files: Add new functions for ath11k caldata") Fixes: https://github.com/openwrt/openwrt/issues/17818 Signed-off-by: Shiji Yang <yangshiji66@qq.com> Link: https://github.com/openwrt/openwrt/pull/17892 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (cherry picked from commit094b6f593f)
This commit is contained in:
parent
9b05ca988c
commit
bccab05ac7
1 changed files with 2 additions and 2 deletions
|
|
@ -125,8 +125,8 @@ caldata_valid() {
|
|||
caldata_patch_data() {
|
||||
local data=$1
|
||||
local data_count=$((${#1} / 2))
|
||||
local data_offset=$(($2))
|
||||
local chksum_offset=$(($3))
|
||||
[ -n "$2" ] && local data_offset=$(($2))
|
||||
[ -n "$3" ] && local chksum_offset=$(($3))
|
||||
local target=$4
|
||||
local fw_data
|
||||
local fw_chksum
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue