From 6b282a03596cfd785e212febc46931b1b6e70d2b Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 5 Oct 2012 02:21:09 -0700 Subject: [PATCH] Bugfix: Don't access elements array out of bounds. --- src/Amount.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Amount.cpp b/src/Amount.cpp index 9c5d0df513..9012cf69f3 100644 --- a/src/Amount.cpp +++ b/src/Amount.cpp @@ -83,9 +83,9 @@ STAmount::STAmount(SField::ref n, const Json::Value& v) throw std::runtime_error("invalid amount string"); value = elements[0]; - if (elements.size() > 0) - currency = elements[1]; if (elements.size() > 1) + currency = elements[1]; + if (elements.size() > 2) issuer = elements[2]; } else