Your message dated Wed, 19 Nov 2014 09:56:40 +0000
with message-id <[email protected]>
and subject line Bug#753560: fixed in libjsoncpp 0.6.0~rc2-3.1
has caused the Debian Bug report #753560,
regarding libjsoncpp: Numerical values cannot be converted to string
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
753560: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753560
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: libjsoncpp
Version: 0.6.0~rc2-3
Severity: normal
Tag: patch

Hello,

libjsoncpp raises an exception when asked to convert a numerical value
to string. According to the investigation of Matthew Bekkema, this is
what causes the bug #733974 against the package minetest: my upstream
fixed their version of libjsoncpp, but the bug still occures in the
debian package, so debian clients are segfaulting when communicating
with non-debian servers. Could you please consider integrating the
attached patch (authored by Matthew)? I could NMU your package to get
that bug fixed, if you prefer.

Here is a simple valid program that is misbehaving:
------------------------------>8----
#include <iostream>
#include <json/json.h>

const std::string test_data = "{\"test\": 9001}";

int main() {
   
   Json::Value root;
   Json::Reader reader;
   reader.parse(test_data,root);
   
   if (root["test"].isConvertibleTo(Json::stringValue)) {
        std::cout << root["test"].asString() << std::endl;
   }
   
   return 0;
}
-----8<-----------------------------

Instead of displaying a simple "9001", it shows:
| terminate called after throwing an instance of 'std::runtime_error'
|   what():  Type is not convertible to string
  
The fix to that bug is a one-liner. As you can see, the patch also
fixes two other errors in the source, where null values where marked
as convertible to arrays and to objects. This is obviously wrong, as
trying to convert null to these types raises the segfaults that we are
observing in minetest.

Thanks for your work,
Mt.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-- 
I don't care whichever programming language we choose, as long as it's C.
--- a/json_value.cpp
+++ b/json_value.cpp
@@ -666,6 +666,7 @@ Value::asString() const
    case booleanValue:
       return value_.bool_ ? "true" : "false";
    case intValue:
+      return valueToString( value_.int_ );
    case uintValue:
    case realValue:
    case arrayValue:
@@ -1423,14 +1424,14 @@ Value::isString() const
 bool 
 Value::isArray() const
 {
-   return type_ == nullValue  ||  type_ == arrayValue;
+   return type_ == arrayValue;
 }
 
 
 bool 
 Value::isObject() const
 {
-   return type_ == nullValue  ||  type_ == objectValue;
+   return type_ == objectValue;
 }
 
 

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: libjsoncpp
Source-Version: 0.6.0~rc2-3.1

We believe that the bug you reported is fixed in the latest version of
libjsoncpp, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Quinson <[email protected]> (supplier of updated libjsoncpp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Wed, 19 Nov 2014 09:14:06 +0100
Source: libjsoncpp
Binary: libjsoncpp0 libjsoncpp-dev
Architecture: source amd64
Version: 0.6.0~rc2-3.1
Distribution: unstable
Urgency: medium
Maintainer: José Luis Segura Lucas <[email protected]>
Changed-By: Martin Quinson <[email protected]>
Description:
 libjsoncpp-dev - Library for reading and writing JSON for C++ (devel files)
 libjsoncpp0 - Library for reading and writing JSON for C++
Closes: 753560
Changes:
 libjsoncpp (0.6.0~rc2-3.1) unstable; urgency=medium
 .
   [ Markus Koschany ]
   * Non-maintainer upload.
   * Add value-as-string.patch. (Closes: #753560)
     Fix conversion of numerical values to string that caused crashes in
     reverse-dependencies such as Minetest.
Checksums-Sha1:
 e452a1a046a59532a0573f94ad9440519eaf418d 1891 libjsoncpp_0.6.0~rc2-3.1.dsc
 5a6b180ed0ad20a29b0b0a2a88167a4733c8ae2a 4852 
libjsoncpp_0.6.0~rc2-3.1.debian.tar.xz
 41e60e93412823800ae7ce336d52c689f8f25dbf 71826 
libjsoncpp0_0.6.0~rc2-3.1_amd64.deb
 7724f96a37ed008f4427ffbbc0d83930dbd75ee4 216536 
libjsoncpp-dev_0.6.0~rc2-3.1_amd64.deb
Checksums-Sha256:
 09ac4c902e575276abcfc876191f5b6d96f2cd61f8d13a9653f8ec7c7faaf9b0 1891 
libjsoncpp_0.6.0~rc2-3.1.dsc
 d2abe156f2c2e57661da480b3c8fd4a4618f78597742e7195907c28c4ba68de1 4852 
libjsoncpp_0.6.0~rc2-3.1.debian.tar.xz
 5daae105b5d8300661ef5c18ead332b513913bf332296b38f3008f247cce9fb0 71826 
libjsoncpp0_0.6.0~rc2-3.1_amd64.deb
 b050d84e611c6283beb26a59f229063bf8ca76848a7ab5ecf70acef965f0904c 216536 
libjsoncpp-dev_0.6.0~rc2-3.1_amd64.deb
Files:
 6be9166cc752466c531a199ffb23b285 71826 libs extra 
libjsoncpp0_0.6.0~rc2-3.1_amd64.deb
 778463c64affdd4c7a738eee7b7387a4 216536 libdevel extra 
libjsoncpp-dev_0.6.0~rc2-3.1_amd64.deb
 e99c8903001ca8f8adcead25c9116121 1891 libs extra libjsoncpp_0.6.0~rc2-3.1.dsc
 e9341b399247f0c27833fb55681e847c 4852 libs extra 
libjsoncpp_0.6.0~rc2-3.1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJUbFHRAAoJEJi9lyRPc76ndOYP/3v8R4gnjb8sj//efVS+WT3O
59Ejf9vXiTL3p6G4V5UIu18l7C7vmTDzvzx+2o/AdgkRb2q6NahG0Fn5nIerGF6E
mrvzCPdoRgMXJYih5OLmx1+LssvYInPqUZdsAzdo81otQzSmUKaFiu7HV9zpk2Z1
JFSxOIn6d7S16pQP9XVi8Vxn7gxV1GVi7k+pRR0DjzwTS3Pb2TN4rgSotLtbmnLX
ymQOwk9gn2iP0Hv9iL7jKM2VyWCnAXKY7javz24HOBVphdW5eldOXCPd6zXL6r5l
yoPkGOxDnsfxshYMQZBc1NrP5mIQuAv6FxaWJYGcV+h5dTLKbe5jEagVqI7STeqv
0DJ/cTWscLK+r1syCP/GB6DBOFTJ6LDpItOcJaWHdBcggvKK8YC2KovlljQiWV7Y
KJxp819A0N8yalfTBqOROrTgClTEcBtmOiGyvXEzeGYbrtBdrNQFcfAbRBzEO2rd
UbUx8ZotbhlS9r9KHrHMVGZWz1IBMIkFYvs4OUk8qDUrte1qXwg8Ju705s1Yr9vq
8WB8CxwQSzPQB0/0KItH6ZIwfrV95plh9NUiva9t4x4RqueCdRpAx/xONOIDReCq
Qw9SmCcvs+PT0WgwEUT1WnpulMX334S5tQ6zS/BD8wRLZmU1MxUK+2ujToVgkC6t
yz63UMYxxmSPqfGa0TT1
=MVWX
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to