public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jim Meyering <meyering@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: gfs2-utils: master - don't dereference NULL for a hostdata string with no "="
Date: Thu, 02 Jul 2009 11:01:00 -0000 [thread overview]
Message-ID: <20090702110121.41A94120363@lists.fedorahosted.org> (raw)
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=c1309888b4824577cc334f3fcdb2b9bbcbe4a84b
Commit: c1309888b4824577cc334f3fcdb2b9bbcbe4a84b
Parent: bf290707a90710422feeef90124459fdc39e783f
Author: Jim Meyering <meyering@redhat.com>
AuthorDate: Mon Jun 29 17:58:16 2009 +0200
Committer: Jim Meyering <meyering@redhat.com>
CommitterDate: Thu Jul 2 12:52:56 2009 +0200
don't dereference NULL for a hostdata string with no "="
* gfs2/mount/util.c (lock_dlm_join): Instead, just ignore it.
---
gfs2/mount/util.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gfs2/mount/util.c b/gfs2/mount/util.c
index 16f8985..cb1a860 100644
--- a/gfs2/mount/util.c
+++ b/gfs2/mount/util.c
@@ -503,9 +503,11 @@ int lock_dlm_join(struct mount_options *mo, struct gen_sb *sb)
if (!mo->hostdata[0])
snprintf(mo->hostdata, PATH_MAX, "%s", ma.hostdata);
else {
- char *p = strstr(ma.hostdata, "=") + 1;
- strcat(mo->hostdata, ":");
- strcat(mo->hostdata, p);
+ const char *p = strstr(ma.hostdata, "=");
+ if (p) {
+ strcat(mo->hostdata, ":");
+ strcat(mo->hostdata, p + 1);
+ }
}
log_debug("lock_dlm_join: hostdata: \"%s\"", mo->hostdata);
reply other threads:[~2009-07-02 11:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090702110121.41A94120363@lists.fedorahosted.org \
--to=meyering@fedoraproject.org \
--cc=cluster-cvs-relay@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).