mirror of https://github.com/oxen-io/lokinet
Rediff patches
Drop 0008-dont-fail-on-0-sized-data-fed-to-json-parser.patch: <REASON> Drop 0009-allow-multiple-calls-to-FeedData.patch: <REASON>ubuntu/groovy
parent
0519e4f30f
commit
ee11e59a26
@ -1,21 +0,0 @@
|
||||
From: Jeff Becker <jeff@i2p.rocks>
|
||||
Date: Sun, 15 Dec 2019 11:59:26 -0500
|
||||
Subject: dont fail on 0 sized data fed to json parser
|
||||
|
||||
---
|
||||
llarp/util/json.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/llarp/util/json.cpp b/llarp/util/json.cpp
|
||||
index 9c9358c..1f0fd22 100644
|
||||
--- a/llarp/util/json.cpp
|
||||
+++ b/llarp/util/json.cpp
|
||||
@@ -23,6 +23,8 @@ namespace llarp
|
||||
bool
|
||||
FeedData(const char* buf, size_t sz) override
|
||||
{
|
||||
+ if(sz == 0)
|
||||
+ return true;
|
||||
if(m_Offset + sz > m_Buf.size() - 1)
|
||||
return false;
|
||||
std::copy(buf, buf + sz, m_Buf.begin());
|
@ -1,21 +0,0 @@
|
||||
From: Jeff Becker <jeff@i2p.rocks>
|
||||
Date: Sun, 15 Dec 2019 12:01:29 -0500
|
||||
Subject: allow multiple calls to FeedData
|
||||
|
||||
---
|
||||
llarp/util/json.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/llarp/util/json.cpp b/llarp/util/json.cpp
|
||||
index 1f0fd22..ef569c1 100644
|
||||
--- a/llarp/util/json.cpp
|
||||
+++ b/llarp/util/json.cpp
|
||||
@@ -27,7 +27,7 @@ namespace llarp
|
||||
return true;
|
||||
if(m_Offset + sz > m_Buf.size() - 1)
|
||||
return false;
|
||||
- std::copy(buf, buf + sz, m_Buf.begin());
|
||||
+ std::copy_n(buf, sz, m_Buf.data() + m_Offset);
|
||||
m_Offset += sz;
|
||||
m_Buf[m_Offset] = 0;
|
||||
return true;
|
Loading…
Reference in New Issue