From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 04/13] simfs: Quiet sanitizer runtime error
Date: Thu, 31 Oct 2024 17:06:11 -0500 [thread overview]
Message-ID: <20241031220638.1582166-4-denkenz@gmail.com> (raw)
In-Reply-To: <20241031220638.1582166-1-denkenz@gmail.com>
The arguments passed into memcpy for src and 'n' are NULL pointer and 0
respectively. Strictly speaking null pointers should not be passed to
memcpy, and this raises a sanitizer runtime error:
src/simfs.c:1057:2: runtime error: null pointer passed as argument 2, which is declared to never be null
Use the newly introduced l_memcpy function to avoid triggering the
sanitizers
---
src/simfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/simfs.c b/src/simfs.c
index c86e8d11fd0b..7f0390032bf6 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -9,7 +9,6 @@
#include <config.h>
#endif
-#include <string.h>
#include <stdio.h>
#include <glib.h>
@@ -27,6 +26,8 @@
#include "storage.h"
#include "missing.h"
+#include <ell/ell.h>
+
#define SIM_CACHE_MODE 0600
#define SIM_CACHE_BASEPATH STORAGEDIR "/%s-%i"
#define SIM_CACHE_VERSION SIM_CACHE_BASEPATH "/version"
@@ -1054,7 +1055,7 @@ int sim_fs_read(struct ofono_sim_context *context, int id,
op->num_bytes = num_bytes;
op->info_only = FALSE;
op->context = context;
- memcpy(op->path, path, path_len);
+ l_memcpy(op->path, path, path_len);
op->path_len = path_len;
g_queue_push_tail(fs->op_q, op);
--
2.45.2
next prev parent reply other threads:[~2024-10-31 22:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 22:06 [PATCH 01/13] qmi: validate TLV length Denis Kenzior
2024-10-31 22:06 ` [PATCH 02/13] gobi: Clear out service request queue on shutdown Denis Kenzior
2024-10-31 22:06 ` [PATCH 03/13] simutil: Return early if file is not found Denis Kenzior
2024-10-31 22:06 ` Denis Kenzior [this message]
2024-10-31 22:06 ` [PATCH 05/13] radio-settings: quiet sanitizer runtime error Denis Kenzior
2024-10-31 22:06 ` [PATCH 06/13] gprs: Default CID range to 1..NUM_CONTEXTS -1 Denis Kenzior
2024-10-31 22:06 ` [PATCH 07/13] qmimodem: Drop call to ofono_gprs_set_cid_range Denis Kenzior
2024-10-31 22:06 ` [PATCH 08/13] gobi: Remove support for qmi_wwan_q Denis Kenzior
2024-10-31 22:06 ` [PATCH 09/13] udevng: Remove non-upstream qmi_wwan_q support Denis Kenzior
2024-10-31 22:06 ` [PATCH 10/13] gobi: Bring down the main interface at startup Denis Kenzior
2024-10-31 22:06 ` [PATCH 11/13] gobi: Support only "usb" Bus values Denis Kenzior
2024-10-31 22:06 ` [PATCH 12/13] gobi: document and validate "interfaceNumber" Denis Kenzior
2024-10-31 22:06 ` [PATCH 13/13] qmi: wda: Convert #defines to an enum Denis Kenzior
2024-11-04 22:20 ` [PATCH 01/13] qmi: validate TLV length patchwork-bot+ofono
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241031220638.1582166-4-denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.