Skip to content

Commit 3aa4e5c

Browse files
Below warning is raised during Static Code Analysis (SCA) using PVS-Studio in webkitbrowser-plugin component at https://github.com/rdkcentral/rdkservices/blob/sprint/25Q1/WebKitBrowser/WebKitBrowser.cpp#L57
_skipURL = _service->WebPrefix().length(); [CWE-197] V1029: Numeric Truncation Error. Return value of the 'length' function is written to the 8-bit variable. In https://github.com/rdkcentral/rdkservices/blob/sprint/25Q1/WebKitBrowser/WebKitBrowser.h#L277 skipURL is declared as uint8_t datatype which is an unsigned int of 8 bits that can store a value ranging from 0 to 255. _ uint8_t _skipURL; _skipURL value is received from the length of the string returned by _service->WebPrefix() method: _skipURL = service->WebPrefix().length(); As per the code WebPrefix contains the string "/Service/WebKitBrowser" and the values of _skipURL and WebPrefix().length are 22 which is within the range value of uint8_t. Probably we would never reach more than 255 value here but in theory service->WebPrefix().length() could return something higher when length() is size_t . If the string length exceeds 255 in the future, it could lead to truncation or unexpected behavior. So wanted to address this warning with fix.
1 parent 3b871d9 commit 3aa4e5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

WebKitBrowser/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ All notable changes to this RDK Service will be documented in this file.
1919

2020
## [1.1.29] - 2025-06-05
2121
### Fixed
22-
-
22+
- Fixed Numeric Truncation Error
2323

2424
## [1.1.28] - 2025-06-04
2525
### Fixed
26-
- Fixed Numeric Truncation Error
26+
- virtual function was overridden incorrectly
2727

2828
## [1.1.27] - 2024-12-18
2929
### Fixed

0 commit comments

Comments
 (0)