summaryrefslogtreecommitdiffstats
path: root/contrib/csup
diff options
context:
space:
mode:
authorlulf <lulf@FreeBSD.org>2008-12-09 21:10:09 +0000
committerlulf <lulf@FreeBSD.org>2008-12-09 21:10:09 +0000
commit7cbf8f4f9597cf67bb793d85edc9bd9a6b3e4617 (patch)
tree392d00b701028bfaf1986d6f414d6872ed2ed879 /contrib/csup
parent338234a6b04249cfcea30453f29257c4cff30f88 (diff)
downloadFreeBSD-src-7cbf8f4f9597cf67bb793d85edc9bd9a6b3e4617.zip
FreeBSD-src-7cbf8f4f9597cf67bb793d85edc9bd9a6b3e4617.tar.gz
- Check return value of the encoded keyword before using it.
Pointed out by: Christian Weisgerber <naddy -at- mips.inka.de>
Diffstat (limited to 'contrib/csup')
-rw-r--r--contrib/csup/rcsfile.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/csup/rcsfile.c b/contrib/csup/rcsfile.c
index 7dd111f..ca9d58f 100644
--- a/contrib/csup/rcsfile.c
+++ b/contrib/csup/rcsfile.c
@@ -232,6 +232,7 @@ rcsfile_send_details(struct rcsfile *rf, struct stream *wr)
{
struct delta *d;
struct tag *t;
+ const char *keyword;
int error;
assert(rf != NULL);
@@ -264,10 +265,13 @@ rcsfile_send_details(struct rcsfile *rf, struct stream *wr)
return(error);
/* Write expand. */
if (rf->expand != EXPAND_DEFAULT) {
- error = proto_printf(wr, "E %s\n",
- keyword_encode_expand(rf->expand));
- if (error)
- return(error);
+ keyword = keyword_encode_expand(rf->expand);
+ if (keyword != NULL) {
+ error = proto_printf(wr, "E %s\n",
+ keyword_encode_expand(rf->expand));
+ if (error)
+ return(error);
+ }
}
/* Write tags to server. */
OpenPOWER on IntegriCloud