Message ID | dc7-6745ac80-5b-3c3e9a40@186771509 |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <ovs-dev-bounces@openvswitch.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XytJm6wjNz1xt3 for <incoming@patchwork.ozlabs.org>; Wed, 27 Nov 2024 19:43:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8A46242AAB; Wed, 27 Nov 2024 08:43:49 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lN_NEfct4Yzp; Wed, 27 Nov 2024 08:43:48 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0D7F742AAA Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0D7F742AAA; Wed, 27 Nov 2024 08:43:48 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D1ADBC08A9; Wed, 27 Nov 2024 08:43:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id D41AEC08A8 for <dev@openvswitch.org>; Tue, 26 Nov 2024 11:18:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id AD71944A33 for <dev@openvswitch.org>; Tue, 26 Nov 2024 11:18:42 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gTMTIQ02EeLZ for <dev@openvswitch.org>; Tue, 26 Nov 2024 11:18:41 +0000 (UTC) X-Greylist: delayed 528 seconds by postgrey-1.37 at util1.osuosl.org; Tue, 26 Nov 2024 11:18:41 UTC DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 19A7242F8B Authentication-Results: smtp4.osuosl.org; dmarc=none (p=none dis=none) header.from=astralinux.ru DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 19A7242F8B Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=37.230.196.243; helo=mail-gw01.astralinux.ru; envelope-from=vlistratenko@astralinux.ru; receiver=<UNKNOWN> Received: from mail-gw01.astralinux.ru (mail-gw01.astralinux.ru [37.230.196.243]) by smtp4.osuosl.org (Postfix) with ESMTPS id 19A7242F8B for <dev@openvswitch.org>; Tue, 26 Nov 2024 11:18:40 +0000 (UTC) Received: from gca-sc-a-srv-ksmg01.astralinux.ru (localhost [127.0.0.1]) by mail-gw01.astralinux.ru (Postfix) with ESMTP id 5624524ADE for <dev@openvswitch.org>; Tue, 26 Nov 2024 14:09:46 +0300 (MSK) Received: from new-mail.astralinux.ru (gca-yc-ruca-srv-mail04.astralinux.ru [10.177.185.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail-gw01.astralinux.ru (Postfix) with ESMTPS for <dev@openvswitch.org>; Tue, 26 Nov 2024 14:09:46 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4XyKbY739NzkWxV for <dev@openvswitch.org>; Tue, 26 Nov 2024 14:09:45 +0300 (MSK) From: =?utf-8?b?0JLQuNGC0LDQu9C40Lkg0JvQuNGB0YLRgNCw0YLQtdC90LrQvg==?= <vlistratenko@astralinux.ru> To: dev@openvswitch.org User-Agent: SOGoMail 5.11.0-rp11 MIME-Version: 1.0 Date: Tue, 26 Nov 2024 14:09:45 +0300 Message-ID: <dc7-6745ac80-5b-3c3e9a40@186771509> X-Forward: 10.198.18.30 X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Envelope-From: vlistratenko@astralinux.ru X-KSMG-AntiSpam-Info: LuaCore: 42 0.3.42 bec10d90a7a48fa5da8c590feab6ebd7732fec6b, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; astralinux.ru:7.1.1; 127.0.0.199:7.1.2; new-mail.astralinux.ru:7.1.1, FromAlignment: s X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiSpam-Lua-Profiles: 189411 [Nov 26 2024] X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Version: 6.1.1.7 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2024/11/26 08:10:00 #26896757 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 X-Mailman-Approved-At: Wed, 27 Nov 2024 08:43:46 +0000 X-Content-Filtered-By: Mailman/MimeDel 2.1.30 Subject: [ovs-dev] =?utf-8?q?=5BPATCH=5D_dynamic-string=3A_Add_checking_an_e?= =?utf-8?q?mpty_template_string_for_strtime=2E?= X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: <ovs-dev.openvswitch.org> List-Unsubscribe: <https://mail.openvswitch.org/mailman/options/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe> List-Archive: <http://mail.openvswitch.org/pipermail/ovs-dev/> List-Post: <mailto:ovs-dev@openvswitch.org> List-Help: <mailto:ovs-dev-request@openvswitch.org?subject=help> List-Subscribe: <https://mail.openvswitch.org/mailman/listinfo/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" <ovs-dev-bounces@openvswitch.org> |
Series |
[ovs-dev] dynamic-string: Add checking an empty template string for strtime.
|
expand
|
diff --git a/lib/dynamic-string.c b/lib/dynamic-string.c index 8e9555a63..241cff26f 100644 --- a/lib/dynamic-string.c +++ b/lib/dynamic-string.c @@ -195,6 +195,10 @@ void ds_put_strftime_msec(struct ds *ds, const char *template, long long int when, bool utc) { + if (template == NULL || *template == '\0') { + return; + } + struct tm_msec tm; if (utc) { gmtime_msec(when, &tm);
If the template is empty, cyclic memory allocation occurs, which leads to an out-of-memory error. Its neccessary to check tepmplate string, and if it is empty, terminate the function. Testing performed via Libfuzzer. Signed-off-by: Vitaly Listratenko <vlistratenko@astralinux.ru> ---