From 2de3bfced35ae060acffc06e66e18279de6f5099 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 6 Mar 2020 09:44:05 +0100 Subject: Fix UB in QProcess deprecation warning fixes The commits e1e08629 and 66e905b1 introduced undefined behavior. Fix this by assigning the result of takeFirst to a temporary. Change-Id: I9e29412cf632d4836b95d47e12d8c07ab0645fbb Reviewed-by: Volker Hilsheimer --- src/corelib/io/qprocess.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qprocess.cpp') diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 9400662b97..4500467ac2 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2522,7 +2522,8 @@ int QProcess::execute(const QString &command) QStringList args = splitCommand(command); if (args.isEmpty()) return -2; - return execute(args.takeFirst(), args); + QString program = args.takeFirst(); + return execute(program, args); } /*! -- cgit v1.2.3