diff --git a/obexd/src/ftp.c b/obexd/src/ftp.c
index fea782c..e730ece 100644
--- a/obexd/src/ftp.c
+++ b/obexd/src/ftp.c
}
dp = opendir(os->current_folder);
+
while (dp && (ep = readdir(dp))) {
gchar *name;
gchar *fullname;
g_free(name);
continue;
}
+
g_free(name);
listing = g_string_append(listing, line);
g_free(line);
}
+
closedir(dp);
listing = g_string_append(listing, FL_BODY_END);
if (os->server->capability == NULL)
return FALSE;
- if (os->server->capability[0] != '!') {
+ if (os->server->capability[0] != '!')
return os_prepare_get(os, os->server->capability, size);
- }
ret = g_spawn_command_line_sync(os->server->capability + 1,
&buf, NULL, &exit, &gerr);
fail:
OBEX_ObjectSetRsp(obj, OBEX_RSP_FORBIDDEN, OBEX_RSP_FORBIDDEN);
-
- return;
}
static gint ftp_delete(struct obex_session *os)
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 3024d54..2c84680 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
dbus_pending_call_cancel(call);
dbus_pending_call_unref(call);
- if (!agent || !agent->new_name) {
+ if (!agent || !agent->new_name)
return -EPERM;
- }
*new_folder = agent->new_folder;
*new_name = agent->new_name;
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 0bfdff9..dc3b9bb 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
OBEX_FL_FIT_ONE_PACKET);
OBEX_ObjectSetRsp(obj, OBEX_RSP_CONTINUE, OBEX_RSP_SUCCESS);
-
}
static gboolean chk_cid(obex_t *obex, obex_object_t *obj, guint32 cid)
}
while (OBEX_ObjectGetNextHeader(obex, obj, &hi, &hd, &hlen)) {
- if (hi == OBEX_HDR_NAME) {
- if (os->name) {
- debug("Ignoring multiple name headers");
- break;
- }
-
- /*
- * This is because OBEX_UnicodeToChar() accesses
- * the string even if its size is zero
- */
- if (hlen == 0) {
- os->name = g_strdup("");
- break;
- }
+ if (hi != OBEX_HDR_NAME)
+ continue;
- os->name = g_convert((const gchar *) hd.bs, hlen,
- "UTF8", "UTF16BE", NULL, NULL, NULL);
+ if (os->name) {
+ debug("Ignoring multiple name headers");
+ break;
+ }
- debug("Set path name: %s", os->name);
+ /* This is because OBEX_UnicodeToChar() accesses the string
+ even if its size is zero */
+ if (hlen == 0) {
+ os->name = g_strdup("");
break;
}
+
+ os->name = g_convert((const gchar *) hd.bs, hlen,
+ "UTF8", "UTF16BE", NULL, NULL, NULL);
+
+ debug("Set path name: %s", os->name);
+ break;
}
os->cmds->setpath(obex, obj);
diff --git a/obexd/src/opp.c b/obexd/src/opp.c
index 390b074..c34899e 100644
--- a/obexd/src/opp.c
+++ b/obexd/src/opp.c
os->name ? os->name : "",
os->type ? os->type : "",
os->size, time, &new_folder,
- &new_name);
+ &new_name);
if (ret < 0)
return -EPERM;
fail:
OBEX_ObjectSetRsp(obj, OBEX_RSP_FORBIDDEN, OBEX_RSP_FORBIDDEN);
-
- return;
}