diff options
author | Katarina Behrens <katarina.behrens@qt.io> | 2023-05-16 15:45:08 +0200 |
---|---|---|
committer | Katarina Behrens <kati@froglogic.com> | 2023-05-24 10:07:13 +0200 |
commit | 5e40bbb186866b143fadabbafd2eed02c723a87f (patch) | |
tree | 01f63f35d331b744e93e334e5fcfeaab300d6098 /src/libs/installer/packagemanagercore_p.cpp | |
parent | 8d72fb0c76db430488066b579fe787caf3889895 (diff) |
Consider full length of 'key=value' string in user arguments
In 'key=value' pairs passed to IFW on command line, 'value' can be
any string, including base64-encoded string which may contain 1 or 2
trailing '=' chars
The current algorithm of splitting 'key=value' string into sections
using '=' as separator and assigning field[1,1] to 'value' works in
most common case (no further '=' chars in 'value'). It fails sometimes
if 'value' is base64-encoded string as it cuts off the portion of
the string at 2nd '=' char and beyond, thereby discards trailing '='s,
which are significant. This invalidates the string.
To avoid this, we use QString.section to return fields[1,-1]
(i.e. everything starting from field1 to the end of the string)
and assign the result to 'value'
Change-Id: Ide4f1510170ad4685b5bb40a96d88898476553ea
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore_p.cpp')
0 files changed, 0 insertions, 0 deletions