Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ell for openSUSE:Factory checked in at 2022-01-27 23:16:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ell (Old) and /work/SRC/openSUSE:Factory/.ell.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ell" Thu Jan 27 23:16:14 2022 rev:26 rq:948509 version:0.48 Changes: -------- --- /work/SRC/openSUSE:Factory/ell/ell.changes 2021-11-24 23:54:33.952460217 +0100 +++ /work/SRC/openSUSE:Factory/.ell.new.1898/ell.changes 2022-01-27 23:16:15.215273853 +0100 @@ -1,0 +2,8 @@ +Mon Jan 24 22:25:21 UTC 2022 - Dirk M??ller <dmuel...@suse.com> + +- update to 0.48: + * Fix issue with memory leaking from ICMPv6 RA. + * Fix issue with memory leaking from DHCP leases. + * Fix issue with NULL terminating of Base64 encoding. + +------------------------------------------------------------------- Old: ---- ell-0.46.tar.sign ell-0.46.tar.xz New: ---- ell-0.48.tar.sign ell-0.48.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ell.spec ++++++ --- /var/tmp/diff_new_pack.5jejNZ/_old 2022-01-27 23:16:15.907269073 +0100 +++ /var/tmp/diff_new_pack.5jejNZ/_new 2022-01-27 23:16:15.915269017 +0100 @@ -1,7 +1,7 @@ # # spec file for package ell # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define lname libell0 Name: ell -Version: 0.46 +Version: 0.48 Release: 0 Summary: Wireless setup and cryptography library License: LGPL-2.1-or-later ++++++ ell-0.46.tar.xz -> ell-0.48.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ChangeLog new/ell-0.48/ChangeLog --- old/ell-0.46/ChangeLog 2021-11-18 20:53:14.000000000 +0100 +++ new/ell-0.48/ChangeLog 2022-01-24 21:40:13.000000000 +0100 @@ -1,3 +1,10 @@ +ver 0.48: + Fix issue with memory leaking from ICMPv6 RA. + +ver 0.47: + Fix issue with memory leaking from DHCP leases. + Fix issue with NULL terminating of Base64 encoding. + ver 0.46: Fix issue with DHCP server when OPTION_ROUTER is not configured. Fix issue with DHCP obtained lease to retrieve it properly. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/README new/ell-0.48/README --- old/ell-0.46/README 2021-11-18 20:53:14.000000000 +0100 +++ new/ell-0.48/README 2022-01-05 22:10:31.000000000 +0100 @@ -49,7 +49,7 @@ =========== Mailing list: - ell@@lists.linux.dev + e...@lists.linux.dev IRC: irc://irc.oftc.net/#ell diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/configure new/ell-0.48/configure --- old/ell-0.46/configure 2021-11-18 20:54:52.000000000 +0100 +++ new/ell-0.48/configure 2022-01-24 21:41:40.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ell 0.46. +# Generated by GNU Autoconf 2.69 for ell 0.48. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='ell' PACKAGE_TARNAME='ell' -PACKAGE_VERSION='0.46' -PACKAGE_STRING='ell 0.46' +PACKAGE_VERSION='0.48' +PACKAGE_STRING='ell 0.48' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1350,7 +1350,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ell 0.46 to adapt to many kinds of systems. +\`configure' configures ell 0.48 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1421,7 +1421,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ell 0.46:";; + short | recursive ) echo "Configuration of ell 0.48:";; esac cat <<\_ACEOF @@ -1548,7 +1548,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ell configure 0.46 +ell configure 0.48 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1913,7 +1913,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ell $as_me 0.46, which was +It was created by ell $as_me 0.48, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2776,7 +2776,7 @@ # Define the identity of the package. PACKAGE='ell' - VERSION='0.46' + VERSION='0.48' cat >>confdefs.h <<_ACEOF @@ -13646,7 +13646,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ell $as_me 0.46, which was +This file was extended by ell $as_me 0.48, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13712,7 +13712,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ell config.status 0.46 +ell config.status 0.48 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/configure.ac new/ell-0.48/configure.ac --- old/ell-0.46/configure.ac 2021-11-18 20:53:14.000000000 +0100 +++ new/ell-0.48/configure.ac 2022-01-24 21:40:13.000000000 +0100 @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(ell, 0.46) +AC_INIT(ell, 0.48) AC_CONFIG_HEADERS(config.h) AC_CONFIG_AUX_DIR(build-aux) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/base64.c new/ell-0.48/ell/base64.c --- old/ell-0.46/ell/base64.c 2018-10-31 23:49:35.000000000 +0100 +++ new/ell-0.48/ell/base64.c 2022-01-05 22:10:31.000000000 +0100 @@ -107,8 +107,7 @@ return out_buf; } -LIB_EXPORT char *l_base64_encode(const uint8_t *in, size_t in_len, - int columns, size_t *n_written) +LIB_EXPORT char *l_base64_encode(const uint8_t *in, size_t in_len, int columns) { const uint8_t *in_end = in + in_len; char *out_buf, *out; @@ -127,8 +126,7 @@ if (columns && out_len) out_len += (out_len - 4) / columns; - out_buf = l_malloc(out_len); - *n_written = out_len; + out_buf = l_malloc(out_len + 1); out = out_buf; @@ -169,5 +167,7 @@ for (; pad < 4; pad++) *out++ = '='; + *out = '\0'; + return out_buf; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/base64.h new/ell-0.48/ell/base64.h --- old/ell-0.46/ell/base64.h 2017-06-10 15:42:47.000000000 +0200 +++ new/ell-0.48/ell/base64.h 2022-01-05 22:10:31.000000000 +0100 @@ -27,8 +27,7 @@ uint8_t *l_base64_decode(const char *in, size_t in_len, size_t *n_written); -char *l_base64_encode(const uint8_t *in, size_t in_len, int columns, - size_t *n_written); +char *l_base64_encode(const uint8_t *in, size_t in_len, int columns); #ifdef __cplusplus } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/dbus-util.c new/ell-0.48/ell/dbus-util.c --- old/ell-0.46/ell/dbus-util.c 2021-03-29 14:19:13.000000000 +0200 +++ new/ell-0.48/ell/dbus-util.c 2022-01-24 21:40:13.000000000 +0100 @@ -39,6 +39,7 @@ #include "dbus-private.h" #include "string.h" #include "queue.h" +#include "utf8.h" #define DBUS_MAX_INTERFACE_LEN 255 #define DBUS_MAX_METHOD_LEN 255 @@ -341,9 +342,18 @@ if (!l_str_has_prefix(name, ":1.")) return false; + name += 3; + + /* + * Disallow '+' or '-' at the beginning of the string + * must have at least one digit + */ + if (!l_ascii_isdigit(*name)) + return false; + errno = 0; - r = strtoull(name + 3, &endp, 10); - if (!endp || endp == name || *endp || errno) + r = strtoull(name, &endp, 10); + if (!endp || *endp || errno) return false; if (out_id) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/dhcp-server.c new/ell-0.48/ell/dhcp-server.c --- old/ell-0.46/ell/dhcp-server.c 2021-11-18 20:53:14.000000000 +0100 +++ new/ell-0.48/ell/dhcp-server.c 2022-01-05 22:10:31.000000000 +0100 @@ -308,6 +308,7 @@ if (ret != 0) return NULL; + l_free(lease->dns); l_free(lease->client_id); memset(lease, 0, sizeof(*lease)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/dhcp6.c new/ell-0.48/ell/dhcp6.c --- old/ell-0.46/ell/dhcp6.c 2021-11-18 20:53:14.000000000 +0100 +++ new/ell-0.48/ell/dhcp6.c 2022-01-24 21:40:13.000000000 +0100 @@ -1467,7 +1467,7 @@ static void dhcp6_client_icmp6_event(struct l_icmp6_client *icmp6, enum l_icmp6_client_event event, - void *user_data) + void *event_data, void *user_data) { struct l_dhcp6_client *client = user_data; @@ -1493,7 +1493,7 @@ return; } - if (l_icmp6_router_get_managed(r)) + if (managed) dhcp6_client_send_initial(client); break; @@ -1521,7 +1521,7 @@ client->request_na = true; client->icmp6 = l_icmp6_client_new(ifindex); - l_icmp6_client_set_event_handler(client->icmp6, + l_icmp6_client_add_event_handler(client->icmp6, dhcp6_client_icmp6_event, client, NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/ecc.c new/ell-0.48/ell/ecc.c --- old/ell-0.46/ell/ecc.c 2021-08-01 21:49:37.000000000 +0200 +++ new/ell-0.48/ell/ecc.c 2022-01-24 21:40:13.000000000 +0100 @@ -538,8 +538,11 @@ if (!data) return NULL; - /* In all cases there should be an X coordinate in data */ - if (len < bytes) + /* Verify the data length matches a full point or X coordinate */ + if (type == L_ECC_POINT_TYPE_FULL) { + if (len != bytes * 2) + return NULL; + } else if (len != bytes) return NULL; p = l_ecc_point_new(curve); @@ -570,9 +573,6 @@ break; case L_ECC_POINT_TYPE_FULL: - if (len < bytes * 2) - goto failed; - _ecc_be2native(p->y, (void *) data + bytes, curve->ndigits); if (!ecc_valid_point(p)) @@ -734,6 +734,11 @@ return p->curve->ndigits * 8; } +LIB_EXPORT bool l_ecc_point_y_isodd(const struct l_ecc_point *p) +{ + return p->y[0] & 1; +} + LIB_EXPORT ssize_t l_ecc_point_get_data(const struct l_ecc_point *p, void *buf, size_t len) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/ecc.h new/ell-0.48/ell/ecc.h --- old/ell-0.46/ell/ecc.h 2021-11-02 15:41:45.000000000 +0100 +++ new/ell-0.48/ell/ecc.h 2022-01-24 21:40:13.000000000 +0100 @@ -69,6 +69,7 @@ const struct l_ecc_curve *l_ecc_point_get_curve(const struct l_ecc_point *p); ssize_t l_ecc_point_get_x(const struct l_ecc_point *p, void *x, size_t xlen); ssize_t l_ecc_point_get_y(const struct l_ecc_point *p, void *y, size_t ylen); +bool l_ecc_point_y_isodd(const struct l_ecc_point *p); ssize_t l_ecc_point_get_data(const struct l_ecc_point *p, void *buf, size_t len); void l_ecc_point_free(struct l_ecc_point *p); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/ell.sym new/ell-0.48/ell/ell.sym --- old/ell-0.46/ell/ell.sym 2021-11-02 15:41:45.000000000 +0100 +++ new/ell-0.48/ell/ell.sym 2022-01-24 21:40:13.000000000 +0100 @@ -342,6 +342,7 @@ l_genl_family_send; l_genl_family_dump; l_genl_family_cancel; + l_genl_family_request_sent; l_genl_family_register; l_genl_family_unregister; /* hwdb */ @@ -530,6 +531,7 @@ l_uintset_clone; l_uintset_intersect; l_uintset_isempty; + l_uintset_size; /* uuid */ l_uuid_v3; l_uuid_v4; @@ -570,6 +572,7 @@ l_ecc_point_from_data; l_ecc_point_get_x; l_ecc_point_get_y; + l_ecc_point_y_isodd; l_ecc_point_get_data; l_ecc_point_inverse; l_ecc_point_multiply; @@ -677,7 +680,7 @@ l_icmp6_client_start; l_icmp6_client_stop; l_icmp6_client_get_router; - l_icmp6_client_set_event_handler; + l_icmp6_client_add_event_handler; l_icmp6_client_set_debug; l_icmp6_client_set_address; l_icmp6_client_set_nodelay; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/genl.c new/ell-0.48/ell/genl.c --- old/ell-0.46/ell/genl.c 2021-06-11 20:09:50.000000000 +0200 +++ new/ell-0.48/ell/genl.c 2022-01-05 22:10:31.000000000 +0100 @@ -1960,6 +1960,22 @@ return true; } +LIB_EXPORT bool l_genl_family_request_sent(struct l_genl_family *family, + unsigned int id) +{ + struct l_genl *genl; + + if (unlikely(!family) || unlikely(!id)) + return false; + + genl = family->genl; + if (!genl) + return false; + + return l_queue_find(genl->pending_list, match_request_id, + L_UINT_TO_PTR(id)) != NULL; +} + static void add_membership(struct l_genl *genl, struct genl_mcast *mcast) { int group = mcast->id; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/genl.h new/ell-0.48/ell/genl.h --- old/ell-0.46/ell/genl.h 2020-04-14 20:24:28.000000000 +0200 +++ new/ell-0.48/ell/genl.h 2022-01-05 22:10:31.000000000 +0100 @@ -141,6 +141,7 @@ void *user_data, l_genl_destroy_func_t destroy); bool l_genl_family_cancel(struct l_genl_family *family, unsigned int id); +bool l_genl_family_request_sent(struct l_genl_family *family, unsigned int id); unsigned int l_genl_family_register(struct l_genl_family *family, const char *group, l_genl_msg_func_t callback, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/icmp6.c new/ell-0.48/ell/icmp6.c --- old/ell-0.46/ell/icmp6.c 2021-11-02 15:41:45.000000000 +0100 +++ new/ell-0.48/ell/icmp6.c 2022-01-24 21:40:13.000000000 +0100 @@ -237,6 +237,12 @@ return 0; } +struct icmp6_event_handler_entry { + l_icmp6_client_event_cb_t handle; + void *user_data; + l_icmp6_destroy_cb_t destroy; +}; + struct l_icmp6_client { uint32_t ifindex; uint8_t mac[6]; @@ -249,9 +255,7 @@ uint32_t route_priority; struct l_queue *routes; - l_icmp6_client_event_cb_t event_handler; - void *event_data; - l_icmp6_destroy_cb_t event_destroy; + struct l_queue *event_handlers; l_icmp6_debug_cb_t debug_handler; l_icmp6_destroy_cb_t debug_destroy; @@ -262,10 +266,17 @@ }; static inline void icmp6_client_event_notify(struct l_icmp6_client *client, - enum l_icmp6_client_event event) + enum l_icmp6_client_event event, + void *event_data) { - if (client->event_handler) - client->event_handler(client, event, client->event_data); + const struct l_queue_entry *entry; + + for (entry = l_queue_get_entries(client->event_handlers); entry; + entry = entry->next) { + struct icmp6_event_handler_entry *handler = entry->data; + + handler->handle(client, event, event_data, handler->user_data); + } } static bool icmp6_client_remove_route(void *data, void *user_data) @@ -275,7 +286,7 @@ if (client->rtnl) l_rtnl_route_delete(client->rtnl, client->ifindex, r, - NULL, NULL, NULL); + NULL, NULL, NULL); l_free(r); return true; @@ -343,7 +354,8 @@ if (!client->ra) { client->ra = r; icmp6_client_event_notify(client, - L_ICMP6_CLIENT_EVENT_ROUTER_FOUND); + L_ICMP6_CLIENT_EVENT_ROUTER_FOUND, + NULL); /* DHCP6 client may have stopped us */ if (!client->ra) @@ -389,9 +401,7 @@ } r = icmp6_client_handle_message(client, ra, l, &src); - if (r == -ECANCELED) - return true; - else if (r < 0) + if (r < 0) goto done; /* Stop solicitations */ @@ -405,9 +415,10 @@ } static void icmp6_client_timeout_send(struct l_timeout *timeout, - void *user_data) + void *user_data) { - static const uint64_t MAX_SOLICITATION_INTERVAL = 3600 * L_MSEC_PER_SEC; + static const uint64_t MAX_SOLICITATION_INTERVAL = + 3600 * L_MSEC_PER_SEC; static const uint64_t SOLICITATION_INTERVAL = 4 * L_MSEC_PER_SEC; struct l_icmp6_client *client = user_data; int r; @@ -446,6 +457,16 @@ return client; } +static void icmp6_event_handler_destroy(void *data) +{ + struct icmp6_event_handler_entry *handler = data; + + if (handler->destroy) + handler->destroy(handler->user_data); + + l_free(handler); +} + LIB_EXPORT void l_icmp6_client_free(struct l_icmp6_client *client) { if (unlikely(!client)) @@ -453,6 +474,8 @@ l_icmp6_client_stop(client); l_queue_destroy(client->routes, NULL); + l_icmp6_client_set_debug(client, NULL, NULL, NULL); + l_queue_destroy(client->event_handlers, icmp6_event_handler_destroy); l_free(client); } @@ -537,20 +560,24 @@ return client->ra; } -LIB_EXPORT bool l_icmp6_client_set_event_handler(struct l_icmp6_client *client, +LIB_EXPORT bool l_icmp6_client_add_event_handler(struct l_icmp6_client *client, l_icmp6_client_event_cb_t handler, - void *userdata, + void *user_data, l_icmp6_destroy_cb_t destroy) { + struct icmp6_event_handler_entry *handler_entry; + if (unlikely(!client)) return false; - if (client->event_destroy) - client->event_destroy(client->event_data); + if (!client->event_handlers) + client->event_handlers = l_queue_new(); - client->event_handler = handler; - client->event_data = userdata; - client->event_destroy = destroy; + handler_entry = l_new(struct icmp6_event_handler_entry, 1); + handler_entry->handle = handler; + handler_entry->user_data = user_data; + handler_entry->destroy = destroy; + l_queue_push_head(client->event_handlers, handler_entry); return true; } @@ -608,8 +635,9 @@ return true; } -LIB_EXPORT bool l_icmp6_client_set_route_priority(struct l_icmp6_client *client, - uint32_t priority) +LIB_EXPORT bool l_icmp6_client_set_route_priority( + struct l_icmp6_client *client, + uint32_t priority) { if (unlikely(!client)) return false; @@ -683,7 +711,6 @@ opts_len -= l; } - r = _icmp6_router_new(); memcpy(r->address, src, sizeof(r->address)); r->prefixes = l_new(struct route_info, n_prefixes); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/icmp6.h new/ell-0.48/ell/icmp6.h --- old/ell-0.46/ell/icmp6.h 2021-08-01 21:49:37.000000000 +0200 +++ new/ell-0.48/ell/icmp6.h 2022-01-24 21:40:13.000000000 +0100 @@ -38,10 +38,10 @@ }; typedef void (*l_icmp6_debug_cb_t)(const char *str, void *user_data); -typedef void (*l_icmp6_destroy_cb_t)(void *userdata); +typedef void (*l_icmp6_destroy_cb_t)(void *user_data); typedef void (*l_icmp6_client_event_cb_t)(struct l_icmp6_client *client, enum l_icmp6_client_event event, - void *userdata); + void *event_data, void *user_data); struct l_icmp6_client *l_icmp6_client_new(uint32_t ifindex); void l_icmp6_client_free(struct l_icmp6_client *client); @@ -51,9 +51,9 @@ const struct l_icmp6_router *l_icmp6_client_get_router( struct l_icmp6_client *client); -bool l_icmp6_client_set_event_handler(struct l_icmp6_client *client, +bool l_icmp6_client_add_event_handler(struct l_icmp6_client *client, l_icmp6_client_event_cb_t handler, - void *userdata, + void *user_data, l_icmp6_destroy_cb_t destroy); bool l_icmp6_client_set_debug(struct l_icmp6_client *client, l_icmp6_debug_cb_t function, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/pem.c new/ell-0.48/ell/pem.c --- old/ell-0.46/ell/pem.c 2021-03-29 14:19:13.000000000 +0200 +++ new/ell-0.48/ell/pem.c 2022-01-05 22:10:31.000000000 +0100 @@ -379,7 +379,8 @@ iov[0].iov_base = "-----BEGIN CERTIFICATE-----\n"; iov[0].iov_len = strlen(iov[0].iov_base); - iov[1].iov_base = l_base64_encode(der, der_len, 64, &iov[1].iov_len); + iov[1].iov_base = l_base64_encode(der, der_len, 64); + iov[1].iov_len = strlen(iov[1].iov_base); iov[2].iov_base = "\n-----END CERTIFICATE-----\n"; iov[2].iov_len = strlen(iov[2].iov_base); r = L_TFR(writev(*fd, iov, 3)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/settings.c new/ell-0.48/ell/settings.c --- old/ell-0.46/ell/settings.c 2021-05-02 13:06:43.000000000 +0200 +++ new/ell-0.48/ell/settings.c 2022-01-24 21:40:13.000000000 +0100 @@ -1061,7 +1061,8 @@ } LIB_EXPORT bool l_settings_get_uint(const struct l_settings *settings, - const char *group_name, const char *key, + const char *group_name, + const char *key, unsigned int *out) { const char *value = l_settings_get_value(settings, group_name, key); @@ -1072,7 +1073,8 @@ if (!value) return false; - if (*value == '\0') + /* Do not allow '+' or '-' or empty string */ + if (!l_ascii_isdigit(*value)) goto error; errno = 0; @@ -1154,7 +1156,8 @@ } LIB_EXPORT bool l_settings_get_uint64(const struct l_settings *settings, - const char *group_name, const char *key, + const char *group_name, + const char *key, uint64_t *out) { const char *value = l_settings_get_value(settings, group_name, key); @@ -1164,7 +1167,8 @@ if (!value) return false; - if (*value == '\0') + /* Do not allow '+' or '-' or empty string */ + if (!l_ascii_isdigit(*value)) goto error; errno = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/tls-suites.c new/ell-0.48/ell/tls-suites.c --- old/ell-0.46/ell/tls-suites.c 2021-08-01 21:49:37.000000000 +0200 +++ new/ell-0.48/ell/tls-suites.c 2022-01-24 21:40:13.000000000 +0100 @@ -534,7 +534,7 @@ params->curve = l_ecc_curve_from_tls_group(tls->negotiated_curve->id); params->public = l_ecc_point_from_data(params->curve, L_ECC_POINT_TYPE_FULL, - buf, len); + buf, point_bytes); tls->pending.key_xchg_params = params; buf += point_bytes; len -= point_bytes; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/uintset.c new/ell-0.48/ell/uintset.c --- old/ell-0.46/ell/uintset.c 2021-03-29 14:19:13.000000000 +0200 +++ new/ell-0.48/ell/uintset.c 2022-01-05 22:10:31.000000000 +0100 @@ -555,3 +555,27 @@ return true; } + +/** + * l_uintset_size + * + * @set: The set of numbers + * + * Returns the number of set elements + */ +LIB_EXPORT uint32_t l_uintset_size(const struct l_uintset *set) +{ + uint16_t i; + uint32_t offset_max; + uint32_t count = 0; + + if (unlikely(!set)) + return 0; + + offset_max = (set->size + BITS_PER_LONG - 1) / BITS_PER_LONG; + + for (i = 0; i < offset_max; i++) + count += __builtin_popcountl(set->bits[i]); + + return count; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/ell/uintset.h new/ell-0.48/ell/uintset.h --- old/ell-0.46/ell/uintset.h 2021-11-02 15:41:45.000000000 +0100 +++ new/ell-0.48/ell/uintset.h 2022-01-05 22:10:31.000000000 +0100 @@ -61,6 +61,7 @@ struct l_uintset *l_uintset_intersect(const struct l_uintset *set_a, const struct l_uintset *set_b); bool l_uintset_isempty(const struct l_uintset *set); +uint32_t l_uintset_size(const struct l_uintset *set); #ifdef __cplusplus } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/unit/test-base64.c new/ell-0.48/unit/test-base64.c --- old/ell-0.46/unit/test-base64.c 2017-06-10 15:42:47.000000000 +0200 +++ new/ell-0.48/unit/test-base64.c 2022-01-05 22:10:31.000000000 +0100 @@ -115,13 +115,12 @@ { const struct base64_encode_test *test = data; char *encoded; - size_t encoded_size; encoded = l_base64_encode((uint8_t *)test->input, strlen(test->input), - test->columns, &encoded_size); + test->columns); assert(encoded); - assert(encoded_size == strlen(test->output)); - assert(!memcmp(encoded, test->output, encoded_size)); + assert(strlen(encoded) == strlen(test->output)); + assert(!memcmp(encoded, test->output, strlen(encoded))); l_free(encoded); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/unit/test-rtnl.c new/ell-0.48/unit/test-rtnl.c --- old/ell-0.46/unit/test-rtnl.c 2020-03-25 10:19:45.000000000 +0100 +++ new/ell-0.48/unit/test-rtnl.c 2022-01-05 22:10:31.000000000 +0100 @@ -147,7 +147,7 @@ { const struct rtmsg *rtmsg = data; char *dst = NULL, *gateway = NULL, *src = NULL; - uint32_t table, ifindex; + uint32_t table = 0, ifindex = 0; test_assert(!error); test_assert(type == RTM_NEWROUTE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ell-0.46/unit/test-uintset.c new/ell-0.48/unit/test-uintset.c --- old/ell-0.46/unit/test-uintset.c 2019-09-17 19:08:29.000000000 +0200 +++ new/ell-0.48/unit/test-uintset.c 2022-01-05 22:10:31.000000000 +0100 @@ -363,6 +363,31 @@ l_uintset_free(b); } +static void test_uintset_size(const void *user_data) +{ + uint32_t i; + struct l_uintset *set = l_uintset_new(32); + + assert(l_uintset_size(set) == 0); + + for (i = 1; i < 32; i++) { + assert(l_uintset_put(set, i)); + assert(l_uintset_size(set) == i); + } + + assert(l_uintset_size(set) == i - 1); + + assert(l_uintset_take(set, 10)); + assert(l_uintset_size(set) == i - 2); + + for (i = 1; i < 32; i++) + assert(l_uintset_take(set, i)); + + assert(l_uintset_size(set) == 0); + + l_uintset_free(set); +} + int main(int argc, char *argv[]) { l_test_init(&argc, &argv); @@ -381,6 +406,7 @@ l_test_add("l_uintset intersect test 2", test_uintset_intersect_test, &intersect_data_2); l_test_add("l_uintset isempty", test_uintset_isempty, NULL); + l_test_add("l_uintset size", test_uintset_size, NULL); return l_test_run(); }