$OpenBSD: patch-src_api_c,v 1.1 2014/01/31 14:05:26 jasper Exp $

Apply libyaml-node-id-hardening.patch
https://bugzilla.redhat.com/show_bug.cgi?id=1033990

--- src/api.c.orig	Sun May 29 07:55:42 2011
+++ src/api.c	Fri Jan 31 13:52:38 2014
@@ -117,7 +117,12 @@ yaml_string_join(
 YAML_DECLARE(int)
 yaml_stack_extend(void **start, void **top, void **end)
 {
-    void *new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2);
+    void *new_start;
+
+    if ((char *)*end - (char *)*start >= INT_MAX / 2)
+	return 0;
+
+    new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2);
 
     if (!new_start) return 0;
 
