Skip to content

Commit 3b871d9

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 54c2a76 commit 3b871d9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

WebKitBrowser/CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ All notable changes to this RDK Service will be documented in this file.
1717
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
1818

1919

20-
## [1.1.28] - 2025-04-06
20+
## [1.1.29] - 2025-06-05
2121
### Fixed
22-
- virtual function was overridden incorrectly
22+
-
23+
24+
## [1.1.28] - 2025-06-04
25+
### Fixed
26+
- Fixed Numeric Truncation Error
2327

2428
## [1.1.27] - 2024-12-18
2529
### Fixed

WebKitBrowser/WebKitBrowser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#define API_VERSION_NUMBER_MAJOR 1
2323
#define API_VERSION_NUMBER_MINOR 1
24-
#define API_VERSION_NUMBER_PATCH 28
24+
#define API_VERSION_NUMBER_PATCH 29
2525

2626
namespace WPEFramework {
2727

0 commit comments

Comments
 (0)