line_func[strlen(line_func) - 1] = '\0';
} else {
XBT_VERB("Cannot run fgets to look for symbol %d, addr %s", i, addrs[i]);
- strcpy(line_func, "???");
+ strncpy(line_func, "???",3);
}
if (fgets(line_pos, 1024, pipe)) {
line_pos[strlen(line_pos) - 1] = '\0';
} else {
XBT_VERB("Cannot run fgets to look for symbol %d, addr %s", i, addrs[i]);
- strcpy(line_pos, backtrace_syms[i]);
+ strncpy(line_pos, backtrace_syms[i],1024);
}
if (strcmp("??", line_func) != 0) {
line_func[strlen(line_func) - 1] = '\0';
} else {
XBT_VERB("Cannot read result of subcommand %s", subcmd);
- strcpy(line_func, "???");
+ strncpy(line_func, "???",3);
}
if (fgets(line_pos, 1024, subpipe)) {
line_pos[strlen(line_pos) - 1] = '\0';
} else {
XBT_VERB("Cannot read result of subcommand %s", subcmd);
- strcpy(line_pos, backtrace_syms[i]);
+ strncpy(line_pos, backtrace_syms[i],1024);
}
pclose(subpipe);
free(subcmd);
dir[p - sel] = '\0';
sel = p + 1;
} else {
- strcpy(dir, sel);
+ strncpy(dir, sel,1024);
done = 1;
}
p = strchr(dir, ':');
if (p) {
- strcpy(unitname, p + 1);
+ strncpy(unitname, p + 1,512);
strncpy(suitename, dir, p - dir);
suitename[p - dir] = '\0';
} else {
- strcpy(suitename, dir);
+ strncpy(suitename, dir,512);
unitname[0] = '\0';
}
cp1 = NULL /*05 give away */ ;
cp2 = mallocex(TOOBIG);
cp3 = mallocex(SMALLAMOUNT);
- strcpy(cp1, "foo");
- strcpy(cp2, "bar");
+ strncpy(cp1, "foo",3);
+ strncpy(cp2, "bar",3);
}
TRY_CLEANUP { /*04 */
printf("cp3=%s", cp3 == NULL /*02 */ ? "" : cp3);
b->size = MAX(minimal_increment + b->used, needed_space);
b->data = xbt_realloc(b->data, b->size);
}
- strcpy(b->data + b->used, toadd);
+ strncpy(b->data + b->used, toadd, b->size-b->used);
b->used += addlen;
}
if (!strncmp(argv[i],\"--tests=\",strlen(\"--tests=\"))) {
char *p=strchr(argv[i],'=')+1;
if (selection[0] == '\\0') {
- strcpy(selection, p);
+ strncpy(selection,p,1024);
} else {
strncat(selection, \",\",1);
- strncat(selection, p, 1024);
+ strncat(selection, p, 1023);
}
} else if (!strcmp(argv[i], \"--verbose\")) {
verbosity++;