ubjsc  0.5
Enterprise-grade C library for manipulating UBJSON
Data Fields
ubjs_parser_settings Struct Reference

Settings for parser. More...

#include <ubjs_parser.h>

Collaboration diagram for ubjs_parser_settings:
Collaboration graph

Data Fields

unsigned int limit_bytes_since_last_callback
 Max number of bytes to process since last callback. If this is 0, limit is effectively off. Else parser errors will occur once you process this-th byte. This setting is global to whole parser.
 
unsigned int limit_container_length
 Max number of items in container. This applies to arrays and objects. If this is 0, limit is effectively off. Else parser errors when: More...
 
unsigned int limit_string_length
 Max number of characters in string or HPN. If this is 0, limit is effectively off. Else parser errors when expected length exceeds the limit. This setting is global to whole parser.
 
unsigned int limit_recursion_level
 Max recursion level for containers. If this is 0, limit is effectively off. Else parser errors when recursion level exceeds the limit. This setting is global to whole parser.
 
ubjs_bool debug
 Debugging mode. If this is UTRUE, parser will fprintf(stderr) lots of internal messages about how and what is being parsed. More...
 

Detailed Description

Settings for parser.

Most options limit some abilities to process data after reaching a threshold. These can prevent the library from crashing upon well-performed denial-of-service attack.

Field Documentation

§ debug

ubjs_bool ubjs_parser_settings::debug

Debugging mode. If this is UTRUE, parser will fprintf(stderr) lots of internal messages about how and what is being parsed.

This is useful only for development or debugging.

§ limit_container_length

unsigned int ubjs_parser_settings::limit_container_length

Max number of items in container. This applies to arrays and objects. If this is 0, limit is effectively off. Else parser errors when:

  • for unoptimized containers, n+1-th item is not an end marker,
  • for optimized containers, when received length and it exceeds the limit. This setting is global to whole parser.

The documentation for this struct was generated from the following file: