From nobody Mon Feb 9 13:37:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633620463; cv=none; d=zohomail.com; s=zohoarc; b=MdhYRH9Ks6e06Hn+2maxafPcHbJKSPcBjm9Byfe7Oql/srSTzY4xbEvpC0bhAxKiRZbOk9JSCDutCBKJ8a1/Vd+jld/XMioaILueey8r7yh8K9ooASni7jz81NpfKsRWHEg8M4nOnXY5iivRSZnlLw3Wzezwf0YUsyLru69+87M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633620463; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iBdKGDOWaxttG6zhCNZhPzCRkSCzYfK7Y7YMqksuQDo=; b=kZq9OwnjSb4/S9w5hWmmj/SRbeFwwHoQo/QEHHR2rCdM4/oif6FhKY9S2Ttp2sY/1i5yoreg8aKbgdVUL2ohlkEth0MvJYPKDBJpyyI4oIzBnTZTTR8mpoAFpiM2IcPlaE7YarMCkPvGau/CNQASgMrgYW8Hp1fvCgfH7HstCn4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16336204634781009.1982967064466; Thu, 7 Oct 2021 08:27:43 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-FOFfj93NN_On5q92l1ppGA-1; Thu, 07 Oct 2021 11:27:39 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD66094B217; Thu, 7 Oct 2021 15:23:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 61DE526E5E; Thu, 7 Oct 2021 15:23:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 34BFF4EA37; Thu, 7 Oct 2021 15:23:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 197FIZng023500 for ; Thu, 7 Oct 2021 11:18:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 94AEC5D6BA; Thu, 7 Oct 2021 15:18:35 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0495D5D740 for ; Thu, 7 Oct 2021 15:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633620462; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iBdKGDOWaxttG6zhCNZhPzCRkSCzYfK7Y7YMqksuQDo=; b=BTrqCDSoB3fgt6ARYv4tJiodQX8pQD03jhUeZXk0cXkYf8sAKYQ5rLl5x2D+15rgQBqGqX rNdzKZAM3N0Z6ZzE91t1TMEr16plsd7ipzhBOCl/TeqvwCkNVY4AuMDWP3zdlBpeo0xSNu 59HfBxiphBlKuI7qwnQk8NwibWHBt0E= X-MC-Unique: FOFfj93NN_On5q92l1ppGA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 002/103] virJSONValueObjectAddVArgs: Add check for presence of the ':' separator Date: Thu, 7 Oct 2021 17:16:50 +0200 Message-Id: <83b75c23e9de49ab0b6087bb379c4a252d22986c.1633619630.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633620463758100001 Content-Type: text/plain; charset="utf-8" Enforce that the ':' separator between the key and value is always present. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virjson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index 70ea71b505..d7e72af8f9 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -161,9 +161,9 @@ virJSONValueObjectAddVArgs(virJSONValue *obj, while ((key =3D va_arg(args, char *)) !=3D NULL) { - if (strlen(key) < 3) { + if (strlen(key) < 3 || key[1] !=3D ':') { virReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' is too short, missing type= prefix"), + _("argument key '%s' is too short or malformed"= ), key); return -1; } --=20 2.31.1