]> andersk Git - libyaml.git/blobdiff - src/yaml_private.h
Fixed pointer arithmetic overflow when calculating the position of a potential simple...
[libyaml.git] / src / yaml_private.h
index 10c4219e7813630bfab27149da86dd1be936a049..ed5ea66cc3ff639316ac8574dcc25b015d7f593f 100644 (file)
@@ -113,6 +113,11 @@ yaml_string_join(
 
 #define STRING(string,length)   { (string), (string)+(length), (string) }
 
+#define STRING_ASSIGN(value,string,length)                                      \
+    ((value).start = (string),                                                  \
+     (value).end = (string)+(length),                                           \
+     (value).pointer = (string))
+
 #define STRING_INIT(context,string,size)                                        \
     (((string).start = yaml_malloc(size)) ?                                     \
         ((string).pointer = (string).start,                                     \
@@ -586,7 +591,7 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
 #define DOCUMENT_INIT(document,document_nodes_start,document_nodes_end,         \
         document_version_directive,document_tag_directives_start,               \
         document_tag_directives_end,document_start_implicit,                    \
-        document_end_implicit,start_mark,end_mark)                              \
+        document_end_implicit,document_start_mark,document_end_mark)            \
     (memset(&(document), 0, sizeof(yaml_document_t)),                           \
      (document).nodes.start = (document_nodes_start),                           \
      (document).nodes.end = (document_nodes_end),                               \
@@ -595,7 +600,9 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
      (document).tag_directives.start = (document_tag_directives_start),         \
      (document).tag_directives.end = (document_tag_directives_end),             \
      (document).start_implicit = (document_start_implicit),                     \
-     (document).end_implicit = (document_end_implicit))
+     (document).end_implicit = (document_end_implicit),                         \
+     (document).start_mark = (document_start_mark),                             \
+     (document).end_mark = (document_end_mark))
 
 /*
  * Node initializers.
This page took 0.027443 seconds and 4 git commands to generate.