diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-05-25 22:27:03 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-05-25 22:27:03 +0000 |
commit | 47af8d49b45fed725016b1bb9e631b8a7c308a9a (patch) | |
tree | e8c62608760583ffd063bc3fb7cf78ca56b6f0a2 /usr.bin/cvs/server.c | |
parent | c7c623ffd6a42edd4b7b8dbfa8e48ced0bf12e35 (diff) |
Call fatal() if we are missing an argument. From Tobias Stoeckmann.
OK niallo@.
Diffstat (limited to 'usr.bin/cvs/server.c')
-rw-r--r-- | usr.bin/cvs/server.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 91c6f5d32c7..70541c00b3e 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.56 2007/05/25 21:58:00 ray Exp $ */ +/* $OpenBSD: server.c,v 1.57 2007/05/25 22:27:02 ray Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -166,7 +166,9 @@ cvs_server_validresp(char *data) char *sp, *ep; struct cvs_resp *resp; - sp = data; + if ((sp = data) == NULL) + fatal("Missing argument for Valid-responses"); + do { if ((ep = strchr(sp, ' ')) != NULL) *ep = '\0'; @@ -241,6 +243,9 @@ cvs_server_sticky(char *data) FILE *fp; char tagpath[MAXPATHLEN]; + if (data == NULL) + fatal("Missing argument for Sticky"); + (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", server_currentdir, CVS_PATH_TAG); @@ -256,6 +261,9 @@ cvs_server_sticky(char *data) void cvs_server_globalopt(char *data) { + if (data == NULL) + fatal("Missing argument for Global_option"); + if (!strcmp(data, "-l")) cvs_nolog = 1; @@ -280,6 +288,9 @@ cvs_server_set(char *data) { char *ep; + if (data == NULL) + fatal("Missing argument for Set"); + ep = strchr(data, '='); if (ep == NULL) fatal("no = in variable assignment"); @@ -344,6 +355,9 @@ cvs_server_entry(char *data) { CVSENTRIES *entlist; + if (data == NULL) + fatal("Missing argument for Entry"); + entlist = cvs_ent_open(server_currentdir); cvs_ent_add(entlist, data); cvs_ent_close(entlist, ENT_SYNC); @@ -358,6 +372,9 @@ cvs_server_modified(char *data) const char *errstr; char *mode, *len, fpath[MAXPATHLEN]; + if (data == NULL) + fatal("Missing argument for Modified"); + mode = cvs_remote_input(); len = cvs_remote_input(); @@ -396,6 +413,9 @@ cvs_server_unchanged(char *data) struct cvs_ent *ent; struct timeval tv[2]; + if (data == NULL) + fatal("Missing argument for Unchanged"); + (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", server_currentdir, data); if ((fd = open(fpath, O_RDWR | O_CREAT | O_TRUNC)) == -1) @@ -432,6 +452,9 @@ cvs_server_argument(char *data) if (server_argc > CVS_CMD_MAXARG) fatal("cvs_server_argument: too many arguments sent"); + if (data == NULL) + fatal("Missing argument for Argument"); + server_argv[server_argc++] = xstrdup(data); } |