From 4390381ebd6fdf3a2a78b3a82ca855603d56d0bc Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 9 Dec 2008 21:10:09 +0000 Subject: [PATCH] - Check return value of the encoded keyword before using it. Pointed out by: Christian Weisgerber --- contrib/csup/rcsfile.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/contrib/csup/rcsfile.c b/contrib/csup/rcsfile.c index 7dd111f5bc55..ca9d58f3ff71 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. */