Skip to content

Commit 295e5d0

Browse files
committed
[SYCL][NFC] Prevent possible out-of-bounds access
1 parent a0c747b commit 295e5d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sycl/source/detail/config.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ void readConfig(bool ForceInitialization) {
106106
// Finding the position of '='
107107
Position = BufString.find("=");
108108
// Checking that the variable name is less than MAX_CONFIG_NAME and more
109-
// than zero character
110-
if ((Position <= MAX_CONFIG_NAME) && (Position > 0)) {
109+
// than zero characters
110+
if ((Position < MAX_CONFIG_NAME) && (Position > 0)) {
111111
// Checking that the value is less than MAX_CONFIG_VALUE and
112112
// more than zero character
113113
if ((BufString.length() - (Position + 1) <= MAX_CONFIG_VALUE) &&

0 commit comments

Comments
 (0)