X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsave.c;h=f01c3186bf313864952610fca304f559f3b9bc08;hp=b95ee2df0f4bbbb27e2281fd694df51bbaee0455;hb=ac41e67e39946acd97752ce52b964976890c5e87;hpb=a7a533cd65d544e8beebabcca5fe906e27af4707 diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c index b95ee2df0..f01c3186b 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -1,18 +1,8 @@ /* - * Copyright (C) 2014 - Jérémie Galarneau + * Copyright (C) 2014 Jérémie Galarneau * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License, version 2 only, as - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -1836,7 +1826,7 @@ static int save_id_tracker(struct config_writer *writer, enum lttng_tracker_type tracker_type) { int ret = LTTNG_OK; - size_t nr_ids = 0, i; + unsigned int nr_ids, i; struct lttng_tracker_ids *ids = NULL; const char *element_id_tracker, *element_target_id, *element_id; const struct lttng_tracker_id *id; @@ -1909,7 +1899,11 @@ static int save_id_tracker(struct config_writer *writer, goto end; } - nr_ids = lttng_tracker_ids_get_count(ids); + status = lttng_tracker_ids_get_count(ids, &nr_ids); + if (status != LTTNG_TRACKER_ID_STATUS_OK) { + ret = LTTNG_ERR_INVALID; + goto end; + } if (nr_ids == 1) { id = lttng_tracker_ids_get_at_index(ids, 0);