View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001085Ecere SDKecerepublic2014-06-18 02:142014-08-08 18:17
Reporterredj 
Assigned Tojerome 
PriorityimmediateSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
Platformx86_64:windowsOS-OS Version-
Product Version0.44.09 
Target Version0.44.10 64Fixed in Version0.44.10 64 
Summary0001085: JSON Map containers Read/Write Support
Description2 cases where json parser will crash on null in a map
use
#define CASE1
and
#define CASE2
Steps To Reproduce#define CASE1
//#define CASE2

import "ecere"

class TestClass
{
public:
   Map<String, NoHead> m;
}

class NoHead : struct
{
public:
   bool a;
   bool b;
}

class Form1 : Window
{
   hasClose = true;
   clientSize = { 632, 438 };

   Button button1
   {
      this, caption = $"button1", position = { 264, 184 };

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         File f = FileOpen("test.json", write);
         if(f)
         {
            Map<String, NoHead> m { };
            TestClass c { m = m };
#ifdef CASE1
            m["k1"] = NoHead { a = true };
            m["k2"] = null;
            m["k0"] = NoHead { };
#endif
#ifdef CASE2
            m["k2"] = null;
#endif
            PrintLn(c.m);
            WriteJSONObject(f, class(TestClass), c, 0);
            delete c;
            delete f;
         }

         f = FileOpen("test.json", read);
         if(f)
         {
            TestClass c = null;
            JSONParser parser { f = f };
            /*JSONResult result = */parser.GetObject(class(TestClass), &c);
            if(c)
               PrintLn(c.m);
         }
         return true;
      }
   };
}

Form1 form1 {};
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0001344)
jerome (administrator)
2014-06-19 05:29

Implemented by:
https://github.com/ecere/ecere-sdk/commit/4cf8f16894fb48b13954b9597fe9aaf43be8c160 [^]

- Issue History
Date Modified Username Field Change
2014-06-18 02:14 redj New Issue
2014-06-18 02:14 redj Status new => assigned
2014-06-18 02:14 redj Assigned To => jerome
2014-06-19 05:19 jerome Summary json parser crash on null entries in a Map of no head class with string key => JSON Map containers Read/Write Support
2014-06-19 05:29 jerome Status assigned => resolved
2014-06-19 05:29 jerome Fixed in Version => 0.44.10 64
2014-06-19 05:29 jerome Resolution open => fixed
2014-06-19 05:29 jerome Note Added: 0001344
2014-08-08 18:17 jerome Status resolved => closed



Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker