From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oPB5H-0004Ex-2X for mharc-grub-devel@gnu.org; Fri, 19 Aug 2022 19:07:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPB5C-00046g-Ki for grub-devel@gnu.org; Fri, 19 Aug 2022 19:07:18 -0400 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:35690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPB5A-0004Mw-WE for grub-devel@gnu.org; Fri, 19 Aug 2022 19:07:18 -0400 Received: by mail-qt1-x829.google.com with SMTP id h22so4417045qtu.2 for ; Fri, 19 Aug 2022 16:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=ILlhSPHYakTucZLpSoYEIAwFgMW/CxI66qgbJkCw4ZY=; b=C9CG6SaTpg2Tfa5iv64Kjs851CfU4YhJTmg5in2HtmShrdmBCJTe0tLWGn7G+7f4qp Snmo3Hvtir0uvL6a/zs0Op0lm0nZ1/rZS1CJbZ8z27OndGl6hybJMD55xBcPrUJ7Lph9 2BRR+SowOJa2Ja8zceBBWR0kFp8sYhgYCfeDta7wa4w9BX/UiWlku6m0NWmmcfES8IQd nu5ifqY48XDnZwQMSF48p50RysiRZx0p6gx0Os+BTlYMlFfXF5uE+UBnvg/P0KYFm8XX 02i9DQHt7drUT/4lvtvwLHXmO7qLkuz5GnqTYs22/dtAE7C5OKJi9eg2PirUDW7iTWSR TSTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=ILlhSPHYakTucZLpSoYEIAwFgMW/CxI66qgbJkCw4ZY=; b=L9eowSxGN8rjbYhEkRkPTM2KkWRqyg2Q3hymIR236Z44GSxRbkbIusEQ4eHvu/KEE7 rn6r/4IGi+6oiWmibkR/q8P0t3MiGqfpXZdWEn4+ZJrnBvc4upnbQX1U+cZAgMNDJknF 8FucfOprSk7WCQt9Wjrx3uBMAUTfs1ceT5cTO56eEQ1LRHK0Z2utTvX4dwmPYZ5At0hH 2aq5mkWYRtQhdCuLBCXnw/es/Kk7rGfLvMiv962ocWq9yjX/EBHJMMZ6wlrJq5hH9CDC pxh6C8e7/nrTxj4in1gPwG4ape9zU2F2er9MQZQNuXqHsALLJ3TJSMiY//N59m1dodrM dNKw== X-Gm-Message-State: ACgBeo29KNMXRkehJ7tuOFRz5mhy8VMxEBcu4I4eLmNd3EzD1Et69Azu 2PbLpLUdB0DTdaIdKpXsR9xMHluYuk5pbA== X-Google-Smtp-Source: AA6agR7tgz+hTI8B4dTWnQKVpTcwdUP2kN9xMylAzh4b9/xryrosmTrmcnPJ9SDxREzx4aT0FmI4Eg== X-Received: by 2002:a05:622a:287:b0:343:6e93:ac49 with SMTP id z7-20020a05622a028700b003436e93ac49mr8572627qtw.75.1660950435906; Fri, 19 Aug 2022 16:07:15 -0700 (PDT) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id fy15-20020a05622a5a0f00b0031eb5648b86sm4017196qtb.41.2022.08.19.16.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 16:07:15 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Patrick Steinhardt , Glenn Washburn , Daniel Kiper Subject: [PATCH v6 1/2] misc: Add cast in grub_strncasecmp() to drop sign when calling grub_tolower() Date: Fri, 19 Aug 2022 18:06:14 -0500 Message-Id: <07b72208be152fbe9c3e35f79da5f1e7ef30c884.1660950080.git.development@efficientek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::829; envelope-from=development@efficientek.com; helo=mail-qt1-x829.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2022 23:07:18 -0000 Note this cast was fixed in grub_strcasecmp() in commit ce41ab7aab (* grub-core/kern/misc.c (grub_strcmp): Use unsigned comparison as per common usage and preffered in several parts of code.), but this commit omitted fixing it in grub_strncasecmp(). Signed-off-by: Glenn Washburn Reviewed-by: Daniel Kiper --- include/grub/misc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grub/misc.h b/include/grub/misc.h index 776dbf8af..1c25c1767 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -232,7 +232,8 @@ grub_strncasecmp (const char *s1, const char *s2, grub_size_t n) while (*s1 && *s2 && --n) { - if (grub_tolower (*s1) != grub_tolower (*s2)) + if (grub_tolower ((grub_uint8_t) *s1) + != grub_tolower ((grub_uint8_t) *s2)) break; s1++; -- 2.34.1