From nobody Tue Jun 07 20:35:43 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3E14784A8D3; Tue, 7 Jun 2022 20:35:44 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LHhvN1DZRz3rx7; Tue, 7 Jun 2022 20:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654634144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcKUguzqanMjlM68GxDAfYo78VGyQ7IUxZ0jU53jk44=; b=jUrc2900hN/YR9Wiv68WoAm1idfJTmMyY4nqBEt96LV6AiwLQ23/eDbR/v8mkGYfk8Dy5s jYb1TNTKHFZdsA6hpFUQ7ZjiIrooSNds9TzWhR9SV49SD02grHp1BeXvfyC4vhzqGwDocx B5QzXX+Hg+oKCWF3sojiHDO+KOABrkeDLQ3Gy8QQTLjyh3RSHvVFdR6vID58dA0e0uuWQI +pnMNmLi/h9ZG6RtX5ohH0wmuji0YeuYxiDTVtLe1YJL6UqcbkLk5Jl83SY1ONXfPK3h4C sY3i9FcG21usyZ21aSgyTF6nQ5usoGUJjFE/jWTLr0hngK0NuLGdOg01VSuivg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AB0522184; Tue, 7 Jun 2022 20:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 257KZhpK022832; Tue, 7 Jun 2022 20:35:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 257KZhsU022831; Tue, 7 Jun 2022 20:35:43 GMT (envelope-from git) Date: Tue, 7 Jun 2022 20:35:43 GMT Message-Id: <202206072035.257KZhsU022831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 0a9541d9f344 - main - pw: reinitialize struct tm before every call to strptime List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a9541d9f34498dfbb0913916652275076198964 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654634144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcKUguzqanMjlM68GxDAfYo78VGyQ7IUxZ0jU53jk44=; b=us50co0Kc3oNc5IX9sSBSVLvguBV/7xmshn4p4iDA5ibp+plUICqeuK4Hsj6duhDL6bjh/ ZPTJPN09aj6j7966Ep62vMazieKAV1xjo3wLMwVgwA/Rn52svwfbVzslnEZYopMQQStLM1 iylYxacCQy1igfPq9OU23sYZFIxJRefnfbKICOrBaAimQ7Co9XpnUpk6/CH1rYZo1nlNDi P0ghYXOk1lL5yd4LB9nI+qLma2U9rAN+PQQ8y+ABx6uR9ISE6wP+pLNbvtSn95scx6hIVz BPPQTVC1oHFIL5NUNBD0oCCKEMrconKV0pehL/A2+FnfjZppeq6IG3sSO0tFwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654634144; a=rsa-sha256; cv=none; b=hTlGoQOcmfMfsC+ic9aCLttma0q1uWUFKOYG6WUCWDKjSCpC2F3cr4e7j5pS+mf0ATMIfU JploLAIXt/nrfXABawMiZl46hzzCw64uvYPyxb/OFdEasdG2OnObA6UGIe5Vs9XTNLmueK 8a6e+V+27fxT429Av2aT9qf93UIw45aOavI30L+serpZ+sdhEOdDKHwacpiJ6YarXrvI29 FcEhUuoFfJ6qiONFmUnKshcllcQAHZwH24fYosvFPUnPds6IMPZBJqjhMq+JJTF/snse4r gUxQTWzo3NxDXjK58s7DCGl+LrwOYIw4i1K2eenbUz3sMHyUEFTDK7P58Nqwgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0a9541d9f34498dfbb0913916652275076198964 commit 0a9541d9f34498dfbb0913916652275076198964 Author: Baptiste Daroussin AuthorDate: 2022-06-07 20:28:13 +0000 Commit: Baptiste Daroussin CommitDate: 2022-06-07 20:32:35 +0000 pw: reinitialize struct tm before every call to strptime This prevents corrupted result due to leftover of previous failed call to strptime --- usr.sbin/pw/psdate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pw/psdate.c b/usr.sbin/pw/psdate.c index 8c833b5c69c7..4baabb30427e 100644 --- a/usr.sbin/pw/psdate.c +++ b/usr.sbin/pw/psdate.c @@ -128,8 +128,8 @@ parse_datesub(char const * str, struct tm *t) l = newlocale(LC_ALL_MASK, "C", NULL); - memset(&tm, 0, sizeof(tm)); for (i=0; valid_formats[i] != NULL; i++) { + memset(&tm, 0, sizeof(tm)); ret = strptime_l(str, valid_formats[i], &tm, l); if (ret && *ret == '\0') { t->tm_mday = tm.tm_mday;