Skip to content

Commit

Permalink
kconfig: Avoid potential issue parsing generated_dts_board.conf
Browse files Browse the repository at this point in the history
Splitting a string like 'foo="bar=baz"' on '=' will give ['foo', '"bar',
'baz"'] instead of the intended ['foo', '"bar=baz"']. split() with
maxsplit=1 to avoid potential issues.

Not seen in practice. Just some future safety.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
  • Loading branch information
ulfalizer authored and nashif committed Apr 18, 2019
1 parent 247337a commit 86b0c22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/kconfig/kconfigfunctions.py
Expand Up @@ -20,7 +20,7 @@
with open(GENERATED_DTS_BOARD_CONF, 'r', encoding='utf-8') as fd:
for line in fd:
if '=' in line:
define, val = line.split('=')
define, val = line.split('=', 1)
dt_defines[define] = val.strip()

def _dt_units_to_scale(unit):
Expand Down

0 comments on commit 86b0c22

Please sign in to comment.