X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib%2Fhashtable.c;h=c5a2b08becf4e9e0ebfac9708f178b8575812ffe;hb=459f1da88b42e9a795e51c73fcd55fd339fc594b;hp=6050dd0829f9ac3ce3bc399d1cc7e9428af3afa0;hpb=be29df6a1ac286e6c482828db28ca96e187c7e00;p=oweals%2Fu-boot.git diff --git a/lib/hashtable.c b/lib/hashtable.c index 6050dd0829..c5a2b08bec 100644 --- a/lib/hashtable.c +++ b/lib/hashtable.c @@ -10,20 +10,7 @@ * This file is part of the GNU C Library. * Contributed by Ulrich Drepper , 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 @@ -830,7 +817,7 @@ int himport_r(struct hsearch_data *htab, * size of 8 per entry (= safety factor of ~5) should provide enough * safety margin for any existing environment definitions and still * allow for more than enough dynamic additions. Note that the - * "size" argument is supposed to give the maximum enviroment size + * "size" argument is supposed to give the maximum environment size * (CONFIG_ENV_SIZE). This heuristics will result in * unreasonably large numbers (and thus memory footprint) for * big flash environments (>8,000 entries for 64 KB @@ -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;