public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* gfs2-utils: master - don't dereference NULL for a hostdata string with no "="
@ 2009-07-02 11:01 Jim Meyering
0 siblings, 0 replies; only message in thread
From: Jim Meyering @ 2009-07-02 11:01 UTC (permalink / raw)
To: cluster-cvs-relay
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-02 11:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-02 11:01 gfs2-utils: master - don't dereference NULL for a hostdata string with no "=" Jim Meyering
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).