- if (!strchr(item->argv[0], '/') && con->execPath) {
- char *s = alloca(strlen(con->execPath) + strlen(item->argv[0]) + sizeof("/"));
- sprintf(s, "%s/%s", con->execPath, item->argv[0]);
+ if (!strchr(item->argv[0], '/') && con->execPath != NULL) {
+ size_t bufsize = strlen(con->execPath) + strlen(item->argv[0]) + sizeof "/";
+ char *s = alloca(bufsize);
+ snprintf(s, bufsize, "%s/%s", con->execPath, item->argv[0]);