ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.pm
(Generate patch)

Comparing JSON-XS/XS.pm (file contents):
Revision 1.78 by root, Wed Dec 5 10:59:28 2007 UTC vs.
Revision 1.79 by root, Wed Dec 19 11:42:52 2007 UTC

1010 1010
1011Third, JSON::XS recurses using the C stack when decoding objects and 1011Third, JSON::XS recurses using the C stack when decoding objects and
1012arrays. The C stack is a limited resource: for instance, on my amd64 1012arrays. The C stack is a limited resource: for instance, on my amd64
1013machine with 8MB of stack size I can decode around 180k nested arrays but 1013machine with 8MB of stack size I can decode around 180k nested arrays but
1014only 14k nested JSON objects (due to perl itself recursing deeply on croak 1014only 14k nested JSON objects (due to perl itself recursing deeply on croak
1015to free the temporary). If that is exceeded, the program crashes. to be 1015to free the temporary). If that is exceeded, the program crashes. To be
1016conservative, the default nesting limit is set to 512. If your process 1016conservative, the default nesting limit is set to 512. If your process
1017has a smaller stack, you should adjust this setting accordingly with the 1017has a smaller stack, you should adjust this setting accordingly with the
1018C<max_depth> method. 1018C<max_depth> method.
1019 1019
1020And last but least, something else could bomb you that I forgot to think 1020And last but least, something else could bomb you that I forgot to think
1024If you are using JSON::XS to return packets to consumption 1024If you are using JSON::XS to return packets to consumption
1025by JavaScript scripts in a browser you should have a look at 1025by JavaScript scripts in a browser you should have a look at
1026L<http://jpsykes.com/47/practical-csrf-and-json-security> to see whether 1026L<http://jpsykes.com/47/practical-csrf-and-json-security> to see whether
1027you are vulnerable to some common attack vectors (which really are browser 1027you are vulnerable to some common attack vectors (which really are browser
1028design bugs, but it is still you who will have to deal with it, as major 1028design bugs, but it is still you who will have to deal with it, as major
1029browser developers care only for features, not about doing security 1029browser developers care only for features, not about getting security
1030right). 1030right).
1031 1031
1032 1032
1033=head1 THREADS 1033=head1 THREADS
1034 1034

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines