]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib/hashtable.c
Merge branch 'master' of git://git.denx.de/u-boot-i2c
[karo-tx-uboot.git] / lib / hashtable.c
index 6050dd0829f9ac3ce3bc399d1cc7e9428af3afa0..644330a17e8ce7a6bdb8f0112094d5c1e884435e 100644 (file)
  * This file is part of the GNU C Library.
  * Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1993.
  *
- * The GNU C Library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * The GNU C Library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the GNU C Library; if not, write to the Free
- * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA.
+ * SPDX-License-Identifier:    LGPL-2.1+
  */
 
 #include <errno.h>
@@ -901,6 +888,12 @@ int himport_r(struct hsearch_data *htab,
                *sp++ = '\0';   /* terminate value */
                ++dp;
 
+               if (*name == 0) {
+                       debug("INSERT: unable to use an empty key\n");
+                       __set_errno(EINVAL);
+                       return 0;
+               }
+
                /* Skip variables which are not supposed to be processed */
                if (!drop_var_from_set(name, nvars, localvars))
                        continue;