struct blob_attr *tb[__RPC_PACKAGELIST_MAX];
int all = false;
struct blob_buf buf = { 0 };
- char var[256], pkg[128], ver[128];
+ char var[256], pkg[128] = { 0 }, ver[128] = { 0 };
char *tmp, *p1, *p2, *p3;
void *tbl;
continue;
if (!strcmp(var, "Package:")) {
- strncpy(pkg, p1, sizeof(pkg));
+ strncpy(pkg, p1, sizeof(pkg) - 1);
continue;
}
}
if (!strcmp(var, "Version:")) {
- strncpy(ver, p1, sizeof(ver));
+ strncpy(ver, p1, sizeof(ver) - 1);
continue;
}