This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/20230 )
Change subject: osmo_strlcpy: Avoid calling memcpy with size=0
......................................................................
osmo_strlcpy: Avoid calling memcpy with size=0
Change-Id: Ic84af86d33c8a20f06036b13d0a10cf312582f0d
---
M src/utils.c
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/utils.c b/src/utils.c
index 3c4a8c9..168f85f 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -545,7 +545,7 @@
/*! Generic big-endian encoding of big endian number up to 64bit
* \param[in] value unsigned integer value to be stored
- * \param[in] data_len number of octets
+ * \param[in] data_len number of octets
* \returns static buffer containing big-endian stored value
*
* This is like osmo_store64be_ext, except that this returns a static buffer of
@@ -577,7 +577,7 @@
if (siz) {
size_t len = (ret >= siz) ? siz - 1 : ret;
- if (src)
+ if (len)
memcpy(dst, src, len);
dst[len] = '\0';
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20230
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic84af86d33c8a20f06036b13d0a10cf312582f0d
Gerrit-Change-Number: 20230
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200922/ffe91466/attachment.htm>