From b036ace23546ef9e44ca20024263c8e31a77ed39 Mon Sep 17 00:00:00 2001
From: Niels Lohmann <mail@nlohmann.me>
Date: Sat, 9 May 2020 14:16:49 +0200
Subject: [PATCH] :bug: fix bug in binary constructor

---
 include/nlohmann/json.hpp        | 3 +--
 single_include/nlohmann/json.hpp | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp
index 480f0e20..9b26dd70 100644
--- a/include/nlohmann/json.hpp
+++ b/include/nlohmann/json.hpp
@@ -2002,8 +2002,7 @@ class basic_json
 
             case value_t::binary:
             {
-                m_value.binary = create<internal_binary_t>(first.m_it.binary_iterator,
-                                 last.m_it.binary_iterator);
+                m_value = *first.m_object->m_value.binary;
                 break;
             }
 
diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp
index fc8c9026..ed415117 100644
--- a/single_include/nlohmann/json.hpp
+++ b/single_include/nlohmann/json.hpp
@@ -17458,8 +17458,7 @@ class basic_json
 
             case value_t::binary:
             {
-                m_value.binary = create<internal_binary_t>(first.m_it.binary_iterator,
-                                 last.m_it.binary_iterator);
+                m_value = *first.m_object->m_value.binary;
                 break;
             }