Fix static analysis issues 92/295492/1 accepted/tizen/unified/20230712.040722
authorTomasz Swierczek <t.swierczek@samsung.com>
Mon, 10 Jul 2023 05:23:58 +0000 (07:23 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Mon, 10 Jul 2023 05:23:58 +0000 (07:23 +0200)
Change-Id: I89454cf5d3014234114ac3ff720ccac24716a47a

src/vcore/XmlsecAdapter.cpp

index 477a229..87d41f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2020 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2016-2023 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -275,7 +275,7 @@ void XmlSec::validateFile(XmlSecContext &context, xmlSecKeysMngrPtr mngrPtr)
        // Set proxy data to dsigCtx
        if (context.isProxyMode && !context.proxySet.empty()) {
                LogDebug("Set proxy data to xmlsec1 handle.");
-               for (auto data : context.proxySet) {
+               for (auto &data : context.proxySet) {
                        if (!strcmp(data.c_str(), "#prop"))
                                continue;
 
@@ -309,7 +309,7 @@ void XmlSec::validateFile(XmlSecContext &context, xmlSecKeysMngrPtr mngrPtr)
                        dsigCtx.get()->flags |= XMLSEC_DSIG_FLAGS_SKIP_PROXY;
 
                dsigCtx.get()->flags |= XMLSEC_DSIG_FLAGS_CHECK_PROXY;
-               for (auto uri : *m_pList) {
+               for (auto &uri : *m_pList) {
                        if(xmlSecProxyCtxAdd(&(dsigCtx.get()->checkReferences),
                                                                 reinterpret_cast<const xmlChar *>(uri.c_str())))
                                ThrowMsg(Exception::InternalError, "PARTIAL_HASH mode failed.");