Hi,

bug fixed. It should work now. Please test.

The problem was, that multibyte sequences in utf8 were not processed at 
all and may result in a endless loop trying to interpret the first byte 
again and again.


Tommi

Am 09.07.2015 um 18:32 schrieb Tommi Mäkitalo:
> Hi,
>
> you are right, this is a bug. And a major one. The json deserializer
> (and also xml deserializer) hang when reading multibyte values. This is
> due to a optimization I made some time ago. I will fix that as soon as
> possible.
>
> Be aware that json rpc and xml rpc is affected also and can result in a
> denial of service.
>
>
> Tommi
>
> Am 08.07.2015 um 20:15 schrieb Jouven:
>> Greetings,
>>
>> I've been working with an "old", from January, version of cxxtools, but
>> recently I've updated to the latest git version.
>> Since this last update I'm having issues deserializing, the execution
>> gets stuck and won't continue.
>>
>> #include <cxxtools/json.h>
>> #include <cxxtools/utf8codec.h>
>>
>> #include <string>
>> #include <iostream>
>> #include <sstream>
>>
>> struct obj
>> {
>>        std::string value;
>>        friend void operator>>=(const cxxtools::SerializationInfo& si,
>>                                obj& varObj)
>>        {
>>            si.getMember("value", varObj.value);
>>            //won't work either using the commented version, the commented
>> version used to work before
>>            //cxxtools::String tmpUtf8;
>>            //si.getMember("value", tmpUtf8);
>>            //varObj.value = cxxtools::Utf8Codec::encode(tmpUtf8);
>>        }
>> };
>>
>> int main()
>> {
>>        obj testObj;
>>        std::string test(R"({"value":"traducción"})");
>>        std::istringstream tmpout2(test);
>>        tmpout2 >> cxxtools::Json(testObj);
>>        std::cout << testObj.value << std::endl;
>> }
>>
>> The execution gets "stuck" at --> tmpout2 >> cxxtools::Json(testObj);
>> No errors. This used to work before. If I remove the 'ó' works.
>>
>> Regards,
>> Joan
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>> _______________________________________________
>> Tntnet-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/tntnet-general
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Tntnet-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tntnet-general


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to