Skip to contentSkip to conversation

Fix: wrong casting of return value

lttng-tool David Goulet 1 participant 1 message Jun 12, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merged!

Quoted 33 lines · Jonathan Rajotte Julien

The function uri_parse_str_urls return a ssize_t and the return was casted to a size_t. This caused the following error checking to fail as -1 was interpreted as 18446744073709551615.

Fixes #803

---
 src/lib/lttng-ctl/save.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/lib/lttng-ctl/save.c +2 -1
index d136b2d..d414a9d 100644
@@ -99,7 +99,8 @@ int lttng_save_session_attr_set_output_url(
 	struct lttng_save_session_attr *attr, const char *url)
 {
 	int ret = 0;
-	size_t len, size;
+	size_t len;
+	ssize_t size;
 	struct lttng_uri *uris = NULL;
 
 	if (!attr) {
Signature · 7 lines
2.0.0


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev