File 0001-Fix-561.-Use-proper-counter-for-the-idx-variable.patch of Package exiv2.30966
From 39343557d154b12479fc69febe2ed6aee3f60173 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= <piponazo@gmail.com>
Date: Mon, 26 Nov 2018 14:24:14 +0100
Subject: [PATCH] Fix #561. Use proper counter for the idx variable
(cherry picked from commit 6e42c1b55e0fc4f360cc56010b0ffe19aa6062d9)
---
src/easyaccess.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/easyaccess.cpp b/src/easyaccess.cpp
index cb9ddacf..97570fbc 100644
--- a/src/easyaccess.cpp
+++ b/src/easyaccess.cpp
@@ -161,7 +161,7 @@ namespace Exiv2 {
std::ostringstream os;
md_st->write(os, &ed);
bool ok = false;
- long st_val = parseLong(os.str(), ok);
+ const long st_val = parseLong(os.str(), ok);
// SensivityType out of range or cannot be parsed properly
if (!ok || st_val < 1 || st_val > 7)
break;
@@ -182,7 +182,7 @@ namespace Exiv2 {
md = md_st;
break;
}
- while (strcmp(sensKeys->keys[idx++], md_st->key().c_str()) != 0 && idx < cnt) {}
+ while (strcmp(sensKeys->keys[idx++], md_st->key().c_str()) != 0 && idx < sensKeys->count) {}
}
break;
}
--
2.25.1