From patchwork Mon Feb 5 21:31:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13546272 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8698658AB0 for ; Mon, 5 Feb 2024 21:32:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168761; cv=none; b=L8X2BaIDuOY4ogcjttX5ijb1qJ3DOKJcBibJP2sarY4XncAMIwvtLU82kXs4SPn1n/ji5zqk+lrk5w/rpskTtVzig3lrrVS0yaZZwJ91pPIKJX/SphlEJ77KPpLnuhEtLDZaUoSajanpUxkqp9Yv9IGE77SgrhPFLKzmm9OREp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168761; c=relaxed/simple; bh=oyCRt/9a3kpe5f3MF/I7sogtVI3zJMPGEkTpZ9BJwRg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Tj5qlneJP720vSQAgBU/2zrKQJaaAVOP5QXVHYr40zNDcNOkpJXgfVKf+/tD94nHBfYYvX2AIrOHMu62jvLYzfb/jIGosUbZ+8EdDm3iBgtrN4kThn15BVMM+Ss53jGTiryBFPg92vEwBWni7SNlBxvpq5eDmRksetBd+J8boDA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bWBAJOr6; arc=none smtp.client-ip=209.85.210.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bWBAJOr6" Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6e12b917df2so3066006a34.1 for ; Mon, 05 Feb 2024 13:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707168758; x=1707773558; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vN+g0mQaIr55/KWG0yQr5dXbCrZ8VlFSxnhARmeMi60=; b=bWBAJOr6N3ftUnREzOhcZKLaqUAnahACSZKa0vbtBuN1Sk/geM7Humu7HuoHzs0TMc uVECS8XS3aI5prAe7CJzvQEueAELd/o8SvLTfjJtwS1KzInWg8xu7yjwal2M1n4Q4iGA oLbH4RJibziroN+dv6mSuoUJoGqzwBDfSwjCIay7rK6t/h15OCevtXMEGjKjfrIGi/Ya yQuvf6cCE3PGGtfwvSVMrxipVnu9bEbOxK8eaD0FCcUY1YFg9n8cJP3a6DHKY8kkMLPw 8TV12erdMCtQl/+2W9YjbgnpDCqFNtTRMMUdEPm2KtNSJ6GGZcg7/zFfs2/s9F4WqHWz 3yIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707168758; x=1707773558; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vN+g0mQaIr55/KWG0yQr5dXbCrZ8VlFSxnhARmeMi60=; b=IHZDi1Jm+g7PNp1sHmJvs+46J/Du3Zq4q8/6zaJn5Pl97C8b50Im4AuYVgdq6BWIOQ +bbJOrIMIi3Yfi/ZIifrLqNZrnSwIy7pN+CP6UT78+D7HUPFmhBhKyyEyWroe0ddotE/ 1AsWwvHCSPzbJ3TacKoXXrZVKUZ/HCxycs1S2ROo6SsKTE+B3zXBxVB71ASm1F1rG4uS 87Tu7mbRewVyC+OQS4VGkMEIpzMGe2ig5oG2HI/jWsZ7IjNiXCbJr2CCrQnw0k9bbWQ1 GYCNgrVWP4BUhfZjyeiptww4BKwi9D1J0QhCJ2D1QX8mjGCxHInB96R1O8RxUi3jslT8 Kcpw== X-Gm-Message-State: AOJu0Yz1+3LbKr5H5TgqO7MGE3L6J8oT/47HIlOVT+/JuOCP2Ok08mKm xdXEapwlwMTQj9ELxd2HsXV78EhMmTxo6b4ZDOs4x+ZsyqRH/mO+SxwMxFDr X-Google-Smtp-Source: AGHT+IG83+AVV1yDiS4SLdIbYenX86dHqw9GOQO6qnF7yFATMJZZeeu2H3DXUebh9oz8lliiubYr+A== X-Received: by 2002:a05:6870:41ce:b0:215:68:65c7 with SMTP id z14-20020a05687041ce00b00215006865c7mr510593oac.12.1707168758353; Mon, 05 Feb 2024 13:32:38 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id mk10-20020a0568700d0a00b002190606a99esm153722oab.53.2024.02.05.13.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:32:37 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 1/6] stkagent: Use l_utf8_get_codepoint Date: Mon, 5 Feb 2024 15:31:22 -0600 Message-ID: <20240205213150.1001245-1-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The GetKey() validation path ensures that the agent returns a single UTF8 character. It performs g_utf8_strlen with a maximum size of 10 bytes in order to minimize unnecessary processing. Convert this code to use the more fitting l_utf8_get_codepoint function, which will read a single UTF8 character from the stream. --- src/stkagent.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/stkagent.c b/src/stkagent.c index a002fe9c716c..6c1f6d57093f 100644 --- a/src/stkagent.c +++ b/src/stkagent.c @@ -639,6 +639,8 @@ static void get_key_cb(DBusPendingCall *call, void *data) enum stk_agent_result result; bool remove_agent; char *key; + int len; + wchar_t cp; if (check_error(agent, reply, ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE, @@ -654,13 +656,19 @@ static void get_key_cb(DBusPendingCall *call, void *data) if (dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &key, - DBUS_TYPE_INVALID) == FALSE || - g_utf8_strlen(key, 10) != 1) { + DBUS_TYPE_INVALID) == FALSE) { ofono_error("Can't parse the reply to GetKey()"); remove_agent = true; goto error; } + len = strlen(key); + if (l_utf8_get_codepoint(key, len, &cp) != len) { + ofono_error("GetKey() return expected a single character"); + remove_agent = true; + goto error; + } + cb(result, key, agent->user_data); CALLBACK_END(); From patchwork Mon Feb 5 21:31:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13546273 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33D2B58ABB for ; Mon, 5 Feb 2024 21:32:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168761; cv=none; b=nsoB0uwfaK3M6VrShcVAf6vveLph3PLi3cvfI/pkbSsvplbXLLr6ldEVyVVDVsI15Do2kJWWlWHwPyB6mhAbe/JSud4Imf4ua2/V1TiwpQm2spOXGyaIToroMM2Vfbterb3HMRXxxKiaaFdgPaSk0KwPDr9kysnxyBQrTUxLzN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168761; c=relaxed/simple; bh=p2Rp7y9jYTVlSOlcLLc10yBJfZYukLIsypUfp8jcSIw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uQfLdhByY2A6ciHD0wY0uZgij116h08oLVVsLUZu4GMssXbbP14AqFSn0H+TQz0PmVX6k0j7bx1xzoiNE739grdNvN3SP4HNpa8HnorCbhx5/JXqRsDDbzoOaOwQTdWg4omCrR3/pLhX+/NImBOQSHGoAFkgDYFpt3wWY3twNCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=M43I/rKr; arc=none smtp.client-ip=209.85.210.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M43I/rKr" Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6e117eec348so95227a34.2 for ; Mon, 05 Feb 2024 13:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707168759; x=1707773559; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rW7lExWa4Tga5wjI9e2Nk+n83htnkzYELoCacuFZ6B4=; b=M43I/rKriuOEiG8oBDX/If66FIGIVTgM3T2s+LB4V/m9IInYWOWVO86i4AxIvyNvXO FQ90D9uEa1BqelToA8BSBh4TK/F3o56zaCLrzD2OcMi3XT1IGe7lvhsu3Q1HVVmLNe5+ ow4/qH0iBW+KIx3Sj9OAJRRxdZQzFbGk8Lv3WbvwgQUZTDSsGnuV/nEGlgein8bxBs7o 5rMz6yApfYtJCLdkixfOIbwEIeranoXoXrgbb4N07G6Dk2aR2khtCh2fyjM20AVMffOJ sstu5NOT7gpzfHf9vFy52+K3jHqzXSJESgcKdRhnAlUPs4kfWjD1AKMrz6drdQ3eDORm SFlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707168759; x=1707773559; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rW7lExWa4Tga5wjI9e2Nk+n83htnkzYELoCacuFZ6B4=; b=HPioerfKHN9+babLWvM8N20nDE24cruP52R9tZ0ZI5PWTRwz0LYHWsDNUld941NlPY 8sdgHvLin5+bJIzqb0cW2+2H39LYI4r17uQW5fskRWOHI0BFDLGd13asTvb7J7/xGGma KtDrt8E0lX6OYnETAe4kAoijKTYYukXduPvq3dbQpcUWUQkQLSZWrQGmEwSbX3GWZITs 456XjEnKe8NXKCCOjp91lSPY3bR5192vWaD+SbVr2S2OMq0ky/HCs+rPAbFSs4i1jKiD qlBpx5qZPOYTiYQ5MrS5bd10olm6CvGtNVqRlTQllqAenZdpsRhXmTurKLbzoJ/gTiBs vRvA== X-Gm-Message-State: AOJu0YwRK8bbGceGVqgzNM7XAwjMTptu5ahNsTNuqL515lUwZFenZz8j XIaQltbTThxB6MLLiD1S53HnEuIxsBUIPBqnZTZQaJ2fxaCBE69mMXIJbBeg X-Google-Smtp-Source: AGHT+IGUJrww7eQ04cNf2MuR4iQCtq8ptOpBCxcbsSxaDieMSf2NUFPusG6I/Fo/17KHX2meEO7vTA== X-Received: by 2002:a05:6870:64a1:b0:218:565c:b6ba with SMTP id cz33-20020a05687064a100b00218565cb6bamr1073734oab.19.1707168759195; Mon, 05 Feb 2024 13:32:39 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id mk10-20020a0568700d0a00b002190606a99esm153722oab.53.2024.02.05.13.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:32:38 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 2/6] core: Remove g_utf8_strlen use Date: Mon, 5 Feb 2024 15:31:23 -0600 Message-ID: <20240205213150.1001245-2-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205213150.1001245-1-denkenz@gmail.com> References: <20240205213150.1001245-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_utf8_strlen --- src/smsutil.c | 2 +- src/stkagent.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smsutil.c b/src/smsutil.c index d07960190103..f46507f00e1c 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -549,7 +549,7 @@ gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc, unsigned char *r; /* TP-OA's 10 octets transport 11 8-bit chars */ - if (g_utf8_strlen(addr, strlen(addr)) > 11) + if (l_utf8_strlen(addr) > 11) return FALSE; gsm = convert_utf8_to_gsm(in->address, len, NULL, &written, 0); diff --git a/src/stkagent.c b/src/stkagent.c index 6c1f6d57093f..8748ec63022c 100644 --- a/src/stkagent.c +++ b/src/stkagent.c @@ -838,7 +838,7 @@ static void get_input_cb(DBusPendingCall *call, void *data) goto error; } - len = g_utf8_strlen(string, -1); + len = l_utf8_strlen(string); if (len < agent->min_length || len > agent->max_length) { ofono_error("Length not acceptable"); From patchwork Mon Feb 5 21:31:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13546274 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1073A58AAF for ; Mon, 5 Feb 2024 21:32:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168762; cv=none; b=UVyerN8vcwqjTTfGPO/tA6Qn0HjFNCYBY3yJdiSmNjvyNjl7UC/nYYJI2TAbLHMhM5Y9cD0d5x9CWD0sAt66IW860I7ty249UonDgxx9j8+TTNrzs80wM3zxyuzlxzHkQYsVZZ9WFLkaRp6WG6FDHbusWUJwe7tZe8QSIhmY6LI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168762; c=relaxed/simple; bh=vzLtM6MkMBJ1TSuPItalVoVVtf6aSoh7YgQkGCV4wnE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OMANZOlD3vmLjJmgecHnLJOAA79u/gdkrrZyCMcxNt5QbXsfeeClmPInV32Oet7NEIptxcJ0vHxw7UNBbef790m/hH1+x9P9Y7fxEsg6OGkzvY1oJ7cWrw2Rt955loWOvkAVwSBeHCZzfxLnAtcO76i0evXmS0zrufRMuKVPXBk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gPIKRKa8; arc=none smtp.client-ip=209.85.160.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gPIKRKa8" Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-214410e969cso2565034fac.0 for ; Mon, 05 Feb 2024 13:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707168760; x=1707773560; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JegzVh25QHy/lavJ0r4AuKJK1WDqy5LTxM4JiU9wnp4=; b=gPIKRKa8HBLaDQCQ5NDomNcQVjF/ZJIiDCz923w8kbGfb8ycEvul0VrclQYu+n9Qth 3T4Ye6qynes+2FdeRip0JCnTorYVts0VZx6SbGVfc5wswooqntP5gDIpEfI/t2nq8j8m yn6MxkVnjPfRnpmCYauZPO2FattnQbFBLZZ+/aborsa+W1H3PnLMIqrU1IUAfXeT039A MyPqD8odva3N/eMbO6/1Lb6AP2Umc8oWJAA8j2LE5oBHPZ9xFrbx1m83JAtYWzCGJP8T +7PMryLXWGIQrcIde/kUo/NfdZ4Y6I9wOsXgc5OqpE7dRyHOvay5bkduq5rQ8o/32YDU QZzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707168760; x=1707773560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JegzVh25QHy/lavJ0r4AuKJK1WDqy5LTxM4JiU9wnp4=; b=QDGlTfuDtgzlJC4tFAwy43kUIz9srTQwYHkChg3EA0H0QmiUddFX/uaVVVgTX1Eyhx wKMujpC/ZO/oGNPu/pl3MjLlHErnruDN2AU+RvosEpCoH/sObOe0DpjKYPFwav7xV6Vu EEJ55meh+wJuUHLZvcl4ZpHtJb2wCtgyQE6djLtgoAuKSpkJsiUuX7e8nqe+UNs2R513 6esQHHyfKc8VdokbKquKKUTvdtL88fyEqsBEnVLg72T+Tt3KDerYvoOyb8F+/uoZiGnW h3KjX2hn9AFo820EB2YWenijtMMt7UZfmNSFYwKAhhEii51K3USraf/y2Iq7hOy1bDxL pvGw== X-Gm-Message-State: AOJu0Yz4ULu+TGfwtCu6xtxsrLzesV8VdLwyj9PiHXjoc0jOBv7UdNLh HD8NoBze972x/wpGKUs9hjO5KflyrnhlNSvl7V5pwE3TTerDOAGQQUKufC5o X-Google-Smtp-Source: AGHT+IECSLyMm+rgp0gnriXJZh6kPQhYuPDeCKBnubnCkM+MQtAazfFElfc17rF8WwvKz+hpM9L7Lw== X-Received: by 2002:a05:6870:8186:b0:218:d8c7:3bcd with SMTP id k6-20020a056870818600b00218d8c73bcdmr407181oae.21.1707168759925; Mon, 05 Feb 2024 13:32:39 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id mk10-20020a0568700d0a00b002190606a99esm153722oab.53.2024.02.05.13.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:32:39 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 3/6] unit: Remove g_utf8_strlen use Date: Mon, 5 Feb 2024 15:31:24 -0600 Message-ID: <20240205213150.1001245-3-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205213150.1001245-1-denkenz@gmail.com> References: <20240205213150.1001245-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace with l_utf8_strlen --- unit/test-sms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unit/test-sms.c b/unit/test-sms.c index 3bc099bcbdeb..154bb33ed244 100644 --- a/unit/test-sms.c +++ b/unit/test-sms.c @@ -1249,7 +1249,7 @@ static void test_prepare_concat(gconstpointer data) sms_assembly_free(assembly); } -static void test_limit(gunichar uni, int target_size, gboolean use_16bit) +static void test_limit(gunichar uni, size_t target_size, gboolean use_16bit) { char *utf8; char *decoded; @@ -1273,7 +1273,7 @@ static void test_limit(gunichar uni, int target_size, gboolean use_16bit) g_assert(g_slist_length(l) == 255); decoded = sms_decode_text(l); - g_assert(g_utf8_strlen(decoded, -1) == target_size); + g_assert(l_utf8_strlen(decoded) == target_size); g_free(decoded); g_slist_free_full(l, g_free); From patchwork Mon Feb 5 21:31:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13546275 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1BF558AC0 for ; Mon, 5 Feb 2024 21:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168763; cv=none; b=jVpawq2PFpCv2z2iEFUQc+tK7nvb6y5lK+0AryIrBPAtG84YVIGjkbS0yKFdAm89hVR//ZLNqfELV2xbIlDstdk/MLLjvslB/qB93SlDh+60K+c3ejq0aJfsae5fzCVArM4w6jiMvAuX9FY9lYtIN2Eyo5Qmj6eyr5VlcIosO2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168763; c=relaxed/simple; bh=Sth1Y5d3wfddusa/fWnoWxESmrVfSp01yY8QfCKBTtI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Riwo+MhesxDSwtiKf72fhNHsOzCJoJuX2BEM6cgd1PM5z7Qi3NdjyhEXfKPZwZ1sx3jma6K1y55YQbeHAMykMzYl5ZCWY8K+GwKqNwk1LyErdi5RaG+A7NwGvHcOEk4VMs9ugU5IPPsrxy1x6c1k/OWE9K5LKCywQ9l02HvOp4M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mDPSRlXj; arc=none smtp.client-ip=209.85.160.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mDPSRlXj" Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-20536d5c5c7so3711309fac.2 for ; Mon, 05 Feb 2024 13:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707168760; x=1707773560; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HuCnxgWeX73XqQSGNZVoSjukxaLZ9KhJ2hLj/t2v71E=; b=mDPSRlXj+bskKKP11xxefasDGnKsGTN/5jA86whAAycspQdERp3/Q0iRS3W0oqL132 VtRxfdwt3UQ0ijy20k2y/LXLSWFyyb2nZl+aQIgg5aqEx3zEJAF6MgdFlX886Vz1fTYf 4YAkXeiT+LujUxpbfE+pqOjr6XMHQ5IvgCta/JVZ670v4D47qKIWOSmiNr4ObZQoZK/1 2Q+ArXwp/c6QXYQBK6uP3qEb21ccbpnWNSjoiDKmVypgYse+0wmP8M+WvzMNXC9pnu4z 68FfNVr4KXXYcWr+gVK6w1O4/xPq4A2Xdj2fiRJ/Q2X/IaI2nUhWwPn1tmiqHpHp5FP8 LNag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707168760; x=1707773560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HuCnxgWeX73XqQSGNZVoSjukxaLZ9KhJ2hLj/t2v71E=; b=KVK6z0soWtQXhXTMNepwtHPwA55qYXc39/DF71QbkTjt5sPKuwi5bOoxp7/+mYcOL5 BkPiEjegnd0GZ/OsMu4EMhQN8lIObBcrIhozlGIbeOB/1rsEEXUUVi3R2K18GK1F4lMq kloFr3NE75aoHQxjo+9bbG4xRGKbI4jkrWoTyQWelEoAiYx9OTAnmhd1oTsfWjkiMmG8 Ghy6RYrFTJeL30Yj/kpeDkrTl6gi3M4h6un5auqOSaYCsU1vNlpr+hOIHuo7dOUMY56B FVcrGhOHO0oKw7zCKD7rV9MsI/ZZFd1kJ3iDfbohcrx/RKEusmXt7WtP8WCxygnJEb8J 06YA== X-Gm-Message-State: AOJu0YwoFzaPuXQJhmMAgiIK7GpMnFdpHFZXr6hXgsL5SLstvhDMhQ5w nVipZw62YEVnTPgfTdVBWxM2E3aDZRx/kvwnh04U/F0mcZ2IV1A4UslrJ8Pj X-Google-Smtp-Source: AGHT+IE8+PGZ/raIY/sxTSHAAduUBn/5YmvyDDMugX5EvdBkJnkwBwrbtHUlyG7YWKnxC43387dnMw== X-Received: by 2002:a05:6870:b52a:b0:219:710b:512c with SMTP id v42-20020a056870b52a00b00219710b512cmr1001195oap.55.1707168760676; Mon, 05 Feb 2024 13:32:40 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id mk10-20020a0568700d0a00b002190606a99esm153722oab.53.2024.02.05.13.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:32:40 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 4/6] qmimodem: Drop use of g_utf8_validate Date: Mon, 5 Feb 2024 15:31:25 -0600 Message-ID: <20240205213150.1001245-4-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205213150.1001245-1-denkenz@gmail.com> References: <20240205213150.1001245-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use l_utf8_validate instead. --- drivers/qmimodem/network-registration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/qmimodem/network-registration.c b/drivers/qmimodem/network-registration.c index 3fa0c9e442fb..6bc8fbc5d226 100644 --- a/drivers/qmimodem/network-registration.c +++ b/drivers/qmimodem/network-registration.c @@ -32,6 +32,8 @@ #include #include +#include + #include "qmi.h" #include "nas.h" #include "util.h" @@ -153,7 +155,7 @@ static bool extract_ss_info(struct qmi_result *result, int *status, * plmn-desc. When that happens, libdbus will abort ofono. * If non-utf-8 characters are detected, use mccmnc string. */ - if (g_utf8_validate(plmn->desc, opname_len, NULL)) { + if (l_utf8_validate(plmn->desc, opname_len, NULL)) { strncpy(operator->name, plmn->desc, opname_len); operator->name[opname_len] = '\0'; } else From patchwork Mon Feb 5 21:31:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13546276 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E26C58AC4 for ; Mon, 5 Feb 2024 21:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168764; cv=none; b=X22P6CDd+wmJB4nr9BwjzBlhzsOvMtpVQKsgT0ssa6h7UjDfiZykgKLCDMsudjuBckWfoB9wHJoX3fCYPLE76lDh70FJA6A0dom2xrzOkDmMqcmyyV6GxeiBJaUT03uf5HEm6kywhtcGvmTL6S3c03tmJJsa+kAuS8AuA6rXL48= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168764; c=relaxed/simple; bh=JMnzRuTJezsH/7/RYqCJAFnR7jnR8Ye0QGdlSVHdcJY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qEVBXF4C4t3y0aA/irEsUTLK/DDu8o/XHODW9tFVlVxomnKWbYzaJGotdtuqMzk00khLgxNiDyPlTmWvznuXRqwCfXliXsWXBi1DgOwxtdbFTTzp5Z7RgtioOSzFFql9yWEB+Otd4LptImOxGlfpwY9RDZVSmz6n4LDeMZhKc5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Cuvc4nVA; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cuvc4nVA" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-21959151f4fso1128867fac.1 for ; Mon, 05 Feb 2024 13:32:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707168761; x=1707773561; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uo9zQdK9futrJ0TNHQ6eCpfSt3EFGzFP36Jk6j0umNI=; b=Cuvc4nVAdHffh5ICo76WCZEQ0TqCwZvShSfhCemdpp03Nn20yNpXnUB+zTTVL71/CL eT33ZJpTzbfIv4pTk7lApPxTMOsGg35pORwInDvC62R3hrLyBrBm8sAmLGaqBaXfK4OQ /Aoiz4iowJBku6j+A64YAevonboEjogcWN/fKAyo40SqD7gAFBHogEbW9TQv4XqBRfew U3/b/tPB7GQx8JBiTXjlSc1QQoqqYV1E0aMkRwPYppzP+93L8l4xDiLePTz3ff4Iu93z a3HjrHa4HNrmz1JZDU0yXFQOoJ8dzyJap64HrJ2O3LuEv1ySjpeAjic0iuI08znklwlZ kzlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707168761; x=1707773561; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uo9zQdK9futrJ0TNHQ6eCpfSt3EFGzFP36Jk6j0umNI=; b=tNslPDP+7wXyMfMxDtUJTFESh5cd2vSzIgXMfH2MqSPWNzXUYtTMrbNUeh7rJPLyOh 0CHi0Sor1upLl7D9Jjde+NmOHznFxacR688rAlPz3KCssJjpujCt+OscLskGcLPc9S4D rT+iesyYwDmBxgUHX+5nnSAUVn6OoamVfVt7Xm7rT72hbO9mDzDTF1UwTAWy9CKzptNy t+a+f2TsgF1h1mkwm6wiYteB0khNsKifJoXoLaxPPyenrbCRWFpODCF7jYje6Qy9npE/ 3a9m5Onpglh6CCuNjjYBbenwzP+RwQOrIlkdIBy2OQqA8qXl5tp53crMPEwIOFmuQhZY ih2g== X-Gm-Message-State: AOJu0YyVfGr2eTzWkEuv4CiqF8FQrabk/bl5h1gxaR7uSavfThQqylNT L8KBgq8DRmCFD1A1OAJqRcNK2C9zHOKghBwSXWXNu424Bjdftjugq9fiyhan X-Google-Smtp-Source: AGHT+IFAhEknW39H1jRJ1zsjXoFxveTx+n6PKzRZJ+/gKmb17Y9qvuckprxxhfvsdeHEWPJW2DbFKw== X-Received: by 2002:a05:6870:1d18:b0:219:abb4:ec1c with SMTP id pa24-20020a0568701d1800b00219abb4ec1cmr431614oab.39.1707168761521; Mon, 05 Feb 2024 13:32:41 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id mk10-20020a0568700d0a00b002190606a99esm153722oab.53.2024.02.05.13.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:32:41 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 5/6] simutil: Drop use of g_utf8_validate_len Date: Mon, 5 Feb 2024 15:31:26 -0600 Message-ID: <20240205213150.1001245-5-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205213150.1001245-1-denkenz@gmail.com> References: <20240205213150.1001245-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use l_utf8_validate instead. --- src/simutil.c | 4 ++-- src/simutil.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/simutil.c b/src/simutil.c index 59d8d5dd9c2d..0354cafd087f 100644 --- a/src/simutil.c +++ b/src/simutil.c @@ -766,7 +766,7 @@ unsigned char *comprehension_tlv_builder_get_data( return tlv + tag_size + len_size; } -gboolean validate_utf8_tlv(const unsigned char *tlv) +bool validate_utf8_tlv(const unsigned char *tlv) { int len = tlv[1]; @@ -777,7 +777,7 @@ gboolean validate_utf8_tlv(const unsigned char *tlv) if (tlv[len + 1] == '\0') len -= 1; - return g_utf8_validate_len((const char *)tlv + 2, len, NULL); + return l_utf8_validate((const char *)tlv + 2, len, NULL); } static char *sim_network_name_parse(const unsigned char *buffer, int length, diff --git a/src/simutil.h b/src/simutil.h index f908bbb44d15..fd3967ffd336 100644 --- a/src/simutil.h +++ b/src/simutil.h @@ -19,6 +19,8 @@ * */ +#include + #define SIM_EFSPN_DC_HOME_PLMN_BIT 0x1 #define SIM_EFSPN_DC_ROAMING_SPN_BIT 0x2 @@ -408,7 +410,7 @@ gboolean comprehension_tlv_builder_set_length( unsigned int len); unsigned char *comprehension_tlv_builder_get_data( struct comprehension_tlv_builder *builder); -gboolean validate_utf8_tlv(const unsigned char *data); +bool validate_utf8_tlv(const unsigned char *data); void ber_tlv_iter_init(struct ber_tlv_iter *iter, const unsigned char *pdu, unsigned int len); From patchwork Mon Feb 5 21:31:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13546277 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BF3258AC5 for ; Mon, 5 Feb 2024 21:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168764; cv=none; b=Ejd8TNYDecKfnUm5WKTv5edpiyuUVAaas1H0pbuVZUHnXblz3ep/L/ebMHxSoCi32zah4hPMN/4YsyF9brp5aJMJPe3OORo+/IG/mqHXk2epr+62d1jTi7bQA4a/keoUc2NKLfp8ZjnXM+YfvJ8rAIWAZ58B2xaB4NTXJch0BUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707168764; c=relaxed/simple; bh=KSAM0+97ycvqtybAk65Fv1CVxlFr7E8pkc1K3f2xvDo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FZvDBLbm7QODLky/CTOjTGEIyDihu8/NZG+gm5036Pi3WI7O92t0U/arSjO4H99P3mzsAK9l7thEjUgGhcsSYZNX+4dyZ48OJSOzalYxIX2lahNlVRX/XBymKnS19ehEhMZeHzOo53N3fd38d7O71WB4JP84Yp+7KcBUcFz1rx4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lAaISnZP; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lAaISnZP" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-204235d0913so2951724fac.1 for ; Mon, 05 Feb 2024 13:32:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707168762; x=1707773562; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xoh83uIX80nRidT0qeUsw/bx7jwClpqh0KDOy/ValZs=; b=lAaISnZPpfPFwljHQZV1W+3oTqEO7Z23RNr9siqkBG43ZSincJmuJTDysCXg8JgyHm PXmLSjavs5DV0HPJV2lNzYxO0qhlGP2IowAipgyaqEpx4herffwTW8CfBJfNWJLSEcQr yVhTAAJnTcKY9fZSdNkGT20ev7HFVtEI4tYgdgFZhM2iP1lLz2DQqzxq63Hzb8C7bbCd AoqTQm6q6qCgFb5v3zWxTEZqrDJAWlIehKGZvkxxAysyZDVBSGr9W9Ix7CGyU7rD4H/z rfJZwLJuU4bdLdlnSjlHBDbm8vr8ck6mBfjRW4Jw/OO7ikg0GRYzLeIZ4mE5Qvlri3Xw uZeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707168762; x=1707773562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xoh83uIX80nRidT0qeUsw/bx7jwClpqh0KDOy/ValZs=; b=mEVjiG7tB3kkwpTTWcynSkwGyiHMT+H8cbWbkmHz2idOnCYyeimYSUGSZQ943ZopJo VVPcGFPB03nExtj6jT+10ihG9n5jlB/rjK97YtQwiZy3xMjUBZdPqWb3Xb298wewdlAo tdhzNLnE2Sg2vwU+Gt7ADJWNqoeMdpiEA493vHnpcE0e11+/25c+vAx4Wz7g9DBpCEY3 QhIOeHgZ3NiBPPMDPod+gKAEiAPLEWjVi5IF0OH9o5ZG11Wh3b7GLfm948lZCJDCN9Lg I8xrHTtGwemA+hWbgcw6Ta09Dt0Y47JlIkA15qI77aEn8kkSP03N2ZUGQW0m2O26kJa8 E//g== X-Gm-Message-State: AOJu0Yx9b7oDBgfDtqb0HnE8I8BU91e8K3H+zlMFdSPbLWOjX+4GCHtz zBsQnwD7gd2R6husmj87ytatDypqLl+ZJTzOOvA5iT4PuD41+Xs3MZyUKZFP X-Google-Smtp-Source: AGHT+IGI8mnXliAWRP4B/wk88WADLkliuyr49YD0X0vs1Eh4X1J/rFkMIpKcK2Jkr/fig9a9SL//bQ== X-Received: by 2002:a05:6870:d889:b0:218:f6d4:d67d with SMTP id oe9-20020a056870d88900b00218f6d4d67dmr903215oac.43.1707168762306; Mon, 05 Feb 2024 13:32:42 -0800 (PST) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id mk10-20020a0568700d0a00b002190606a99esm153722oab.53.2024.02.05.13.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:32:42 -0800 (PST) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 6/6] unit: Update to the new API Date: Mon, 5 Feb 2024 15:31:27 -0600 Message-ID: <20240205213150.1001245-6-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205213150.1001245-1-denkenz@gmail.com> References: <20240205213150.1001245-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The function now returns stdbool instead of gboolean, so update the use accordingly and to the new coding style. --- unit/test-simutil.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unit/test-simutil.c b/unit/test-simutil.c index 530f624e6b0b..8364f200c665 100644 --- a/unit/test-simutil.c +++ b/unit/test-simutil.c @@ -97,14 +97,14 @@ static void test_validate_tlv(void) unsigned char impi_invalid1[] = { 0x80, 0x4, 'F', '\0', 'O', '\0' }; unsigned char impi_invalid2[] = { 0x80, 0x4, 0xff, 0xff, 0xff, 0xff }; - g_assert(validate_utf8_tlv(impi_none) == FALSE); - g_assert(validate_utf8_tlv(impi_empty) == TRUE); - g_assert(validate_utf8_tlv(impi_term1) == TRUE); - g_assert(validate_utf8_tlv(impi_term2) == TRUE); - g_assert(validate_utf8_tlv(impi_term3) == TRUE); - g_assert(validate_utf8_tlv(impi_term4) == TRUE); - g_assert(validate_utf8_tlv(impi_invalid1) == FALSE); - g_assert(validate_utf8_tlv(impi_invalid2) == FALSE); + g_assert(!validate_utf8_tlv(impi_none)); + g_assert(validate_utf8_tlv(impi_empty)); + g_assert(validate_utf8_tlv(impi_term1)); + g_assert(validate_utf8_tlv(impi_term2)); + g_assert(validate_utf8_tlv(impi_term3)); + g_assert(validate_utf8_tlv(impi_term4)); + g_assert(!validate_utf8_tlv(impi_invalid1)); + g_assert(!validate_utf8_tlv(impi_invalid2)); } static void test_ber_tlv_builder_mms(void)