RejectedSoftware Forums

Sign up

data.json.parseJsonString() bug

In parseJsonString, the following code produces an Error in certain
circumstances which is not easily caught. Since I am accepting
json objects from users, it would be nice if this was changed.

for example the string "{"x": fo}" will crash this because the enforce
message does not check to see if there is 5 characters to report.
This is used throughout some of the other cases as well.

switch( range.front ){

case 'f':
	enforce(range[1 .. $].startsWith("alse"), "Expected 'false', got 

'"~range[0 .. 5]~"'.");

range.popFrontN(5);
ret = false;
break;


How should I submit these in the future/patches? Also, it seems like
some things have been fixed in git, but ~master doesn't have them. How
do I get my project to use the cutting edge with dub?

Thanks much!

Re: data.json.parseJsonString() bug

On Mon, 30 Sep 2013 13:14:17 -0400, S wrote:

In parseJsonString, the following code produces an Error in certain
circumstances which is not easily caught. Since I am accepting
json objects from users, it would be nice if this was changed.

for example the string "{"x": fo}" will crash this because the enforce
message does not check to see if there is 5 characters to report.
This is used throughout some of the other cases as well.

switch( range.front ){

case 'f':
	enforce(range[1 .. $].startsWith("alse"), "Expected 'false', got 

'"~range[0 .. 5]~"'.");

range.popFrontN(5);
ret = false;
break;


How should I submit these in the future/patches? Also, it seems like
some things have been fixed in git, but ~master doesn't have them. How
do I get my project to use the cutting edge with dub?

Thanks much!

Thanks, I'll fix that right away. To get the latest version a manual "dub upgrade" should work. Alternatively, you can also "git clone" the repository manually and add it to dub using "dub add-local". You can then use git to update or revert to older versions when needed.

WRT issues/patches see my other reply: http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/4996/#post-5038

Re: data.json.parseJsonString() bug

Fixed: https://github.com/rejectedsoftware/vibe.d/commit/570a7bc8203bb2281490642b0da84c464854ba11

Re: data.json.parseJsonString() bug

On Mon, 30 Sep 2013 13:14:17 -0400, S wrote:

How should I submit these in the future/patches?

You should create account on GitHub, browse and edit source file directly in vibe.d repository, fork and create pull request. This is possible via GitHub web interface. Look for "edit" and "pull request" buttons.

Also, it seems like
some things have been fixed in git, but ~master doesn't have them. How
do I get my project to use the cutting edge with dub?

Try "dub upgrade" command.