maint.mk: add sc_vulnerable_makefile_CVE-2012-3386
[gnulib.git] / lib / tsearch.c
index a2e053a..dddbdbf 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-1997, 2000, 2006-2007 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997, 2000, 2006-2007, 2009-2012 Free Software
+   Foundation, Inc.
    Contributed by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>, 1997.
 
    NOTE: The canonical source of this file is maintained with the GNU C
 
 #include <config.h>
 
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the rootp == NULL tests below.  */
+#define _GL_ARG_NONNULL(params)
+
 /* Specification.  */
 #ifdef IN_LIBINTL
 # include "tsearch.h"
@@ -157,7 +162,7 @@ check_tree (node root)
   if (root == NULL)
     return;
   root->red = 0;
-  for(p = root->left; p; p = p->left)
+  for (p = root->left; p; p = p->left)
     cnt += !p->red;
   check_tree_recurse (root, 0, cnt);
 }