Skip to content
This repository was archived by the owner on Nov 10, 2021. It is now read-only.
This repository was archived by the owner on Nov 10, 2021. It is now read-only.

Bug in oc_core_res.c #22

@river45

Description

@river45

Hi,

I think that I found a bug in the function oc_core_get_resource_by_uri() in api/oc_core_res.c on master branch.

oc_resource_t *
oc_core_get_resource_by_uri(const char *uri, int device)
{
  int skip = 0, type = 0;
  if (uri[0] != '/')
    skip = 1;
...
}

In the code above the variable skip would means a number of leading slash of the uri.
So the code would be fixed like this.

oc_resource_t *
oc_core_get_resource_by_uri(const char *uri, int device)
{
  int skip = 0, type = 0;
  if (uri[0] == '/')
    skip = 1;
...
}

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions