const char *locale, uid_t uid, char **query, GList **bind_params)
{
int joined = 0;
+ int size;
char buf[MAX_QUERY_LEN] = { '\0' };
char buf2[MAX_QUERY_LEN] = { '\0' };
char *condition = NULL;
}
if (joined & E_PMINFO_PKGINFO_JOIN_PRIVILEGE_INFO)
strncat(buf2, join_privilege_info, sizeof(buf2) - strlen(buf2) - 1);
- strncat(buf2, buf, sizeof(buf2) - strlen(buf2) - 1);
- *query = strdup(buf2);
+ size = strlen(buf2) + strlen(buf) + 1;
+ *query = (char *)calloc(1, size);
if (*query == NULL)
return PMINFO_R_ERROR;
+ snprintf(*query, size, "%s%s", buf2, buf);
return PMINFO_R_OK;
}