Skip to content

Commit

Permalink
core: fix use of uninitialized variable for object size
Browse files Browse the repository at this point in the history
By default it is now assigned to OBJECT_SIZE_UNKNOWN so the plugins are
only necessary to change its size if they really know the size of object.
  • Loading branch information
Luiz Augusto von Dentz committed Jul 6, 2010
1 parent 8a14edd commit f6ec4d5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
3 changes: 0 additions & 3 deletions plugins/filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,6 @@ static void *capability_open(const char *name, int oflag, mode_t mode,

object->watch = g_child_watch_add(object->pid, script_exited, object);

if (size)
*size = 1;

done:
if (err)
*err = 0;
Expand Down
9 changes: 0 additions & 9 deletions plugins/pbap.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,6 @@ static void *vobject_pull_open(const char *name, int oflag, mode_t mode,
if (ret < 0)
goto fail;

if (size)
*size = OBJECT_SIZE_UNKNOWN;

return pbap;

fail:
Expand Down Expand Up @@ -737,9 +734,6 @@ static void *vobject_list_open(const char *name, int oflag, mode_t mode,
goto fail;

done:
if (size)
*size = OBJECT_SIZE_UNKNOWN;

return pbap;

fail:
Expand Down Expand Up @@ -789,9 +783,6 @@ static void *vobject_vcard_open(const char *name, int oflag, mode_t mode,
if (ret < 0)
goto fail;

if (size)
*size = OBJECT_SIZE_UNKNOWN;

return pbap;

fail:
Expand Down
2 changes: 1 addition & 1 deletion src/obex.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ int obex_get_stream_start(struct obex_session *os, const char *filename)
{
int err;
void *object;
size_t size;
size_t size = OBJECT_SIZE_UNKNOWN;

object = os->driver->open(filename, O_RDONLY, 0, os->service_data,
&size, &err);
Expand Down

0 comments on commit f6ec4d5

Please sign in to comment.