From patchwork Fri Oct 28 10:44:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 79896 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1103787qge; Fri, 28 Oct 2016 03:45:13 -0700 (PDT) X-Received: by 10.36.37.197 with SMTP id g188mr1908336itg.110.1477651513498; Fri, 28 Oct 2016 03:45:13 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id rz6si4283128pab.140.2016.10.28.03.45.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2016 03:45:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1B90881D7E; Fri, 28 Oct 2016 03:45:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6BAE481D7C for ; Fri, 28 Oct 2016 03:45:03 -0700 (PDT) Received: by mail-wm0-x22c.google.com with SMTP id 79so12478360wmy.0 for ; Fri, 28 Oct 2016 03:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EgZS3yAsvdbzb7OAymXkgxtnehVG6xDA/F+9mebAons=; b=fEfZo+/rwqgC++r77I9waA6xmuSTRevvAJoQk1+onwxJRr02dKO5b/9Vi17ObRHVvP hhZtD3w+6s5g3BWy0f/3Xf+NHolTL7MPJ/aRj8tp5o1RltzrBOe1ZUCafB1FR87dLKE/ ErUBq2U9nl4bIHpiwNbxrWLGuNvLxAOr4ehu8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EgZS3yAsvdbzb7OAymXkgxtnehVG6xDA/F+9mebAons=; b=Bytok04Stg1rlnSoBKGhQLJSaIV4VJZ21BvyHEEq/xKWjSgs3QXCw/IIoowijCx+6M +2FCNExcG0D0AWbmdE8WW990pioYkIgEzz9/z7GfkBuumSri2aH66usNpXXvSb/CVH2e V8FOb4vxG7v3e9d19FLnR4SpBUXotkHbiXyNZJcx91t7uIxUeoFOi7Vy/EeTT67PxbGv G1d2xvP/ZcqHum4jCLyj7eDDfqQ3MoRhi7YS7Sz6HcwTLKWEspCSLi16F15+y2iNznBA 9nHTe29lxvYe0955POZLKwBaGn6K81/661OnmJYIh/pxpxEFXQke8wmjsM4xJlw104Ij pTYA== X-Gm-Message-State: ABUngve/L4l8r+oblcPrCE3uHly8b/IVQ7DaTg6kMYIKoQZk2FRGdKmGsrmZnnwCfwc0YNlt X-Received: by 10.28.95.213 with SMTP id t204mr3165235wmb.18.1477651502285; Fri, 28 Oct 2016 03:45:02 -0700 (PDT) Received: from localhost.localdomain ([105.150.227.229]) by smtp.gmail.com with ESMTPSA id 184sm57730wms.4.2016.10.28.03.45.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Oct 2016 03:45:01 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Fri, 28 Oct 2016 11:44:37 +0100 Message-Id: <1477651478-16830-9-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> References: <1477651478-16830-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 8/9] EmbeddedPkg/MmcDxe: eliminate deprecated string function calls X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ryan.harkin@linaro.org, lersek@redhat.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Get rid of calls to unsafe string functions. These are deprecated and may be removed in the future. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- EmbeddedPkg/Universal/MmcDxe/Diagnostics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek Reviewed-by: Leif Lindholm diff --git a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c index 783e548d2aed..7d6a5a0dde01 100644 --- a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c +++ b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c @@ -42,9 +42,9 @@ DiagnosticLog ( ) { UINTN len = StrLen (Str); - if (len <= mLogRemainChar) { + if (len < mLogRemainChar) { + StrCpyS (mLogBuffer, mLogRemainChar, Str); mLogRemainChar -= len; - StrCpy (mLogBuffer, Str); mLogBuffer += len; return len; } else {