=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/server.c,v retrieving revision 1.52 retrieving revision 1.53 diff -c -r1.52 -r1.53 *** src/usr.bin/cvs/server.c 2007/01/26 11:19:44 1.52 --- src/usr.bin/cvs/server.c 2007/01/31 21:07:36 1.53 *************** *** 1,4 **** ! /* $OpenBSD: server.c,v 1.52 2007/01/26 11:19:44 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: server.c,v 1.53 2007/01/31 21:07:36 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 81,97 **** int cvs_server(int argc, char **argv) { - int l; char *cmd, *data; struct cvs_req *req; server_argv[0] = xstrdup("server"); cvs_server_path = xmalloc(MAXPATHLEN); ! l = snprintf(cvs_server_path, MAXPATHLEN, "%s/cvs-serv%d", cvs_tmpdir, getpid()); - if (l == -1 || l >= MAXPATHLEN) - fatal("cvs_server: overflow in server path"); if (mkdir(cvs_server_path, 0700) == -1) fatal("failed to create temporary server directory: %s, %s", --- 81,94 ---- int cvs_server(int argc, char **argv) { char *cmd, *data; struct cvs_req *req; server_argv[0] = xstrdup("server"); cvs_server_path = xmalloc(MAXPATHLEN); ! (void)xsnprintf(cvs_server_path, MAXPATHLEN, "%s/cvs-serv%d", cvs_tmpdir, getpid()); if (mkdir(cvs_server_path, 0700) == -1) fatal("failed to create temporary server directory: %s, %s", *************** *** 291,297 **** void cvs_server_directory(char *data) { - int l; CVSENTRIES *entlist; char *dir, *repo, *parent, entry[CVS_ENT_MAXLINELEN], *dirn, *p; --- 288,293 ---- *************** *** 325,333 **** if (strcmp(parent, ".")) { entlist = cvs_ent_open(parent); ! l = snprintf(entry, CVS_ENT_MAXLINELEN, "D/%s////", dirn); ! if (l == -1 || l >= CVS_ENT_MAXLINELEN) ! fatal("cvs_server_directory: overflow"); cvs_ent_add(entlist, entry); cvs_ent_close(entlist, ENT_SYNC); --- 321,327 ---- if (strcmp(parent, ".")) { entlist = cvs_ent_open(parent); ! (void)xsnprintf(entry, CVS_ENT_MAXLINELEN, "D/%s////", dirn); cvs_ent_add(entlist, entry); cvs_ent_close(entlist, ENT_SYNC); *************** *** 611,625 **** void cvs_server_update_entry(const char *resp, struct cvs_file *cf) { - int l; char *p, response[MAXPATHLEN]; if ((p = strrchr(cf->file_rpath, ',')) != NULL) *p = '\0'; ! l = snprintf(response, MAXPATHLEN, "%s %s/", resp, cf->file_wd); ! if (l == -1 || l >= MAXPATHLEN) ! fatal("cvs_server_update_entry: overflow"); cvs_server_send_response("%s", response); cvs_remote_output(cf->file_rpath); --- 605,616 ---- void cvs_server_update_entry(const char *resp, struct cvs_file *cf) { char *p, response[MAXPATHLEN]; if ((p = strrchr(cf->file_rpath, ',')) != NULL) *p = '\0'; ! (void)xsnprintf(response, MAXPATHLEN, "%s %s/", resp, cf->file_wd); cvs_server_send_response("%s", response); cvs_remote_output(cf->file_rpath);