From owner-svn-src-stable@freebsd.org Fri Dec 11 00:30:42 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FBAF4BDA82; Fri, 11 Dec 2020 00:30:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CsWsZ1PDzz4YGH; Fri, 11 Dec 2020 00:30:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22BE521A76; Fri, 11 Dec 2020 00:30:42 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0BB0Uf6P078458; Fri, 11 Dec 2020 00:30:41 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0BB0UfSh078457; Fri, 11 Dec 2020 00:30:41 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202012110030.0BB0UfSh078457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 11 Dec 2020 00:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368538 - stable/12/sys/cam/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12/sys/cam/mmc X-SVN-Commit-Revision: 368538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2020 00:30:42 -0000 Author: jkim Date: Fri Dec 11 00:30:41 2020 New Revision: 368538 URL: https://svnweb.freebsd.org/changeset/base/368538 Log: MFC: r367997 Do not truncate the last character from serial number. strlcpy() requires one more byte for the NULL character. Modified: stable/12/sys/cam/mmc/mmc_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/mmc/mmc_da.c ============================================================================== --- stable/12/sys/cam/mmc/mmc_da.c Fri Dec 11 00:28:28 2020 (r368537) +++ stable/12/sys/cam/mmc/mmc_da.c Fri Dec 11 00:30:41 2020 (r368538) @@ -1262,12 +1262,12 @@ sdda_start_init(void *context, union ccb *start_ccb) device->serial_num_len = strlen(softc->card_sn_string); device->serial_num = (u_int8_t *)malloc((device->serial_num_len + 1), M_CAMXPT, M_NOWAIT); - strlcpy(device->serial_num, softc->card_sn_string, device->serial_num_len); + strlcpy(device->serial_num, softc->card_sn_string, device->serial_num_len + 1); device->device_id_len = strlen(softc->card_id_string); device->device_id = (u_int8_t *)malloc((device->device_id_len + 1), M_CAMXPT, M_NOWAIT); - strlcpy(device->device_id, softc->card_id_string, device->device_id_len); + strlcpy(device->device_id, softc->card_id_string, device->device_id_len + 1); strlcpy(mmcp->model, softc->card_id_string, sizeof(mmcp->model));