libopensc: initialize 'sc_path' type variables ...
it's needed to initialize the 'aid' member of 'struct sc_path' git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5064 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
42fbe85a52
commit
5a7f8a2d60
|
@ -195,6 +195,8 @@ int sc_path_set(sc_path_t *path, int type, const u8 *id, size_t id_len,
|
||||||
{
|
{
|
||||||
if (path == NULL || id == NULL || id_len == 0 || id_len > SC_MAX_PATH_SIZE)
|
if (path == NULL || id == NULL || id_len == 0 || id_len > SC_MAX_PATH_SIZE)
|
||||||
return SC_ERROR_INVALID_ARGUMENTS;
|
return SC_ERROR_INVALID_ARGUMENTS;
|
||||||
|
|
||||||
|
memset(path, 0, sizeof(*path));
|
||||||
memcpy(path->value, id, id_len);
|
memcpy(path->value, id, id_len);
|
||||||
path->len = id_len;
|
path->len = id_len;
|
||||||
path->type = type;
|
path->type = type;
|
||||||
|
@ -320,8 +322,13 @@ int sc_compare_path_prefix(const sc_path_t *prefix, const sc_path_t *path)
|
||||||
|
|
||||||
const sc_path_t *sc_get_mf_path(void)
|
const sc_path_t *sc_get_mf_path(void)
|
||||||
{
|
{
|
||||||
static const sc_path_t mf_path = { {0x3f, 0x00, 0, 0, 0, 0, 0, 0,
|
static const sc_path_t mf_path = {
|
||||||
0, 0, 0, 0, 0, 0, 0, 0}, 2, 0, 0, SC_PATH_TYPE_PATH};
|
{0x3f, 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
SC_PATH_TYPE_PATH,
|
||||||
|
{{0},0}
|
||||||
|
};
|
||||||
return &mf_path;
|
return &mf_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,8 @@ static void check_ret(int r, int op, const char *err, const sc_file_t *file)
|
||||||
|
|
||||||
static int arg_to_path(const char *arg, sc_path_t *path, int is_id)
|
static int arg_to_path(const char *arg, sc_path_t *path, int is_id)
|
||||||
{
|
{
|
||||||
|
memset(path, 0, sizeof(sc_path_t));
|
||||||
|
|
||||||
if (strncasecmp(arg, "aid:", strlen("aid:")) == 0) {
|
if (strncasecmp(arg, "aid:", strlen("aid:")) == 0) {
|
||||||
/* DF aid */
|
/* DF aid */
|
||||||
const char *p = arg + strlen("aid:");
|
const char *p = arg + strlen("aid:");
|
||||||
|
|
Loading…
Reference in New Issue