[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog add.c client.c entries.c log...
From: |
Mark D. Baushke |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog add.c client.c entries.c log... |
Date: |
Thu, 11 May 2006 17:10:37 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Branch:
Changes by: Mark D. Baushke <address@hidden> 06/05/11 17:10:37
Modified files:
src : ChangeLog add.c client.c entries.c log.c
logmsg.c vers_ts.c
Log message:
Merge changes from 1.11.x.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/ChangeLog.diff?tr1=1.3403&tr2=1.3404&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/add.c.diff?tr1=1.122&tr2=1.123&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/client.c.diff?tr1=1.449&tr2=1.450&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/entries.c.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/log.c.diff?tr1=1.104&tr2=1.105&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/logmsg.c.diff?tr1=1.101&tr2=1.102&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/vers_ts.c.diff?tr1=1.66&tr2=1.67&r1=text&r2=text
Patches:
Index: ccvs/src/ChangeLog
diff -u ccvs/src/ChangeLog:1.3403 ccvs/src/ChangeLog:1.3404
--- ccvs/src/ChangeLog:1.3403 Wed May 10 02:35:59 2006
+++ ccvs/src/ChangeLog Thu May 11 17:10:37 2006
@@ -1,3 +1,30 @@
+2006-05-11 Mark D. Baushke <address@hidden>
+
+ * add.c (add_directory): Protect tag from NULL dereference.
+ [Fixes NetBSD cid-1054.]
+
+ * client.c (handle_mt): Deal with missing text argument.
+ [Fixes NetBSD cid-924.]
+
+ * entries.c (Entnode_Create): Protect date, tag and ts_conflict
+ from possible NULL dereference.
+ [Fixes NetBSD coverity cid-994, cid-995, cid-1055, cid-1057.]
+
+ * entries.c (Entries_Open): Protect dirtag and dirdate from
+ possible NULL dereference.
+ [Fixes NetBSD coverity cid-996.]
+
+ * log.c (cvslog): Validate start and end args to
+ date_to_internet().
+ [Fixes NetBSD coverity cid-2427 and cid-2428.]
+
+ * logmsg.c (fmt_proc): Protect li->tag from NULL dereference.
+ [Fixes NetBSD coverity cid-997.]
+
+ * vers_ts.c (Version_TS): Protect tag and vers_ts->tag from NULL
+ dereference.
+ [Fixes NetBSD coverity cid-1053.]
+
2006-05-08 Derek Price <address@hidden>
* sign.c (gen_signature), verify.c (verify_signature): s/%a/%@/ &
Index: ccvs/src/add.c
diff -u ccvs/src/add.c:1.122 ccvs/src/add.c:1.123
--- ccvs/src/add.c:1.122 Mon Apr 24 18:50:25 2006
+++ ccvs/src/add.c Thu May 11 17:10:37 2006
@@ -858,7 +858,7 @@
p->key = xstrdup ("- New directory");
li = xmalloc (sizeof (struct logfile_info));
li->type = T_TITLE;
- li->tag = xstrdup (tag);
+ li->tag = tag ? xstrdup (tag) : NULL;
li->rev_old = li->rev_new = NULL;
p->data = li;
(void) addnode (ulist, p);
Index: ccvs/src/client.c
diff -u ccvs/src/client.c:1.449 ccvs/src/client.c:1.450
--- ccvs/src/client.c:1.449 Thu May 4 16:49:03 2006
+++ ccvs/src/client.c Thu May 11 17:10:37 2006
@@ -3918,7 +3918,7 @@
cvs_output ("\n", 1);
free (updated_fname);
}
- updated_fname = xstrdup (text);
+ updated_fname = text ? xstrdup (text) : NULL;
}
/* Swallow all other tags. Either they are extraneous
or they reflect future extensions that we can
@@ -3928,17 +3928,17 @@
{
if (!strcmp (tag, "conflicts"))
{
- if (!strcmp (text, "No"))
+ if (text == NULL || !strcmp (text, "No"))
importmergecmd.conflicts = -1;
else
importmergecmd.conflicts = atoi (text);
}
else if (!strcmp (tag, "mergetag1"))
- importmergecmd.mergetag1 = xstrdup (text);
+ importmergecmd.mergetag1 = text ? xstrdup (text) : NULL;
else if (!strcmp (tag, "mergetag2"))
- importmergecmd.mergetag2 = xstrdup (text);
+ importmergecmd.mergetag2 = text ? xstrdup (text) : NULL;
else if (!strcmp (tag, "repository"))
- importmergecmd.repository = xstrdup (text);
+ importmergecmd.repository = text ? xstrdup (text) : NULL;
/* Swallow all other tags. Either they are text for
which we are going to print our own version when we
see -importmergecmd, or they are future extensions
@@ -3948,9 +3948,12 @@
printf ("\n");
else if (!strcmp (tag, "date"))
{
- char *date = format_date_alloc (text);
- printf ("%s", date);
- free (date);
+ if (text)
+ {
+ char *date = format_date_alloc (text);
+ printf ("%s", date);
+ free (date);
+ }
}
else if (text)
printf ("%s", text);
Index: ccvs/src/entries.c
diff -u ccvs/src/entries.c:1.67 ccvs/src/entries.c:1.68
--- ccvs/src/entries.c:1.67 Mon Apr 24 18:50:26 2006
+++ ccvs/src/entries.c Thu May 11 17:10:37 2006
@@ -57,7 +57,8 @@
TRACE (TRACE_FLOW,
"Entnode_Create (%s, %s, %s, %s, %s, %s, %s)",
- user, vn, ts, options, tag, date, ts_conflict);
+ user, vn, ts, options, TRACE_NULL (tag), TRACE_NULL (date),
+ TRACE_NULL (ts_conflict));
/* Note that timestamp and options must be non-NULL */
ent = xmalloc (sizeof (Entnode));
@@ -66,9 +67,9 @@
ent->version = xstrdup (vn);
ent->timestamp = xstrdup (ts ? ts : "");
ent->options = xstrdup (options ? options : "");
- ent->tag = xstrdup (tag);
- ent->date = xstrdup (date);
- ent->conflict = xstrdup (ts_conflict);
+ ent->tag = tag ? xstrdup (tag) : NULL;
+ ent->date = date ? xstrdup (date) : NULL;
+ ent->conflict = ts_conflict ? xstrdup (ts_conflict) : NULL;
return ent;
}
@@ -480,8 +481,8 @@
sdtp = xmalloc (sizeof (*sdtp));
memset (sdtp, 0, sizeof (*sdtp));
sdtp->aflag = aflag;
- sdtp->tag = xstrdup (dirtag);
- sdtp->date = xstrdup (dirdate);
+ sdtp->tag = dirtag ? xstrdup (dirtag) : NULL;
+ sdtp->date = dirdate ? xstrdup (dirdate) : NULL;
sdtp->nonbranch = dirnonbranch;
/* feed it into the list-private area */
Index: ccvs/src/log.c
diff -u ccvs/src/log.c:1.104 ccvs/src/log.c:1.105
--- ccvs/src/log.c:1.104 Mon Apr 24 18:50:26 2006
+++ ccvs/src/log.c Thu May 11 17:10:37 2006
@@ -327,17 +327,20 @@
{
p = log_data.datelist;
log_data.datelist = p->next;
- send_to_server ("Argument -d\012", 0);
- send_to_server ("Argument ", 0);
- date_to_internet (datetmp, p->start);
- send_to_server (datetmp, 0);
- if (p->inclusive)
- send_to_server ("<=", 0);
- else
- send_to_server ("<", 0);
- date_to_internet (datetmp, p->end);
- send_to_server (datetmp, 0);
- send_to_server ("\012", 0);
+ if (p->start && p->end)
+ {
+ send_to_server ("Argument -d\012", 0);
+ send_to_server ("Argument ", 0);
+ date_to_internet (datetmp, p->start);
+ send_to_server (datetmp, 0);
+ if (p->inclusive)
+ send_to_server ("<=", 0);
+ else
+ send_to_server ("<", 0);
+ date_to_internet (datetmp, p->end);
+ send_to_server (datetmp, 0);
+ send_to_server ("\012", 0);
+ }
if (p->start)
free (p->start);
if (p->end)
@@ -348,13 +351,15 @@
{
p = log_data.singledatelist;
log_data.singledatelist = p->next;
- send_to_server ("Argument -d\012", 0);
- send_to_server ("Argument ", 0);
- date_to_internet (datetmp, p->end);
- send_to_server (datetmp, 0);
- send_to_server ("\012", 0);
if (p->end)
+ {
+ send_to_server ("Argument -d\012", 0);
+ send_to_server ("Argument ", 0);
+ date_to_internet (datetmp, p->end);
+ send_to_server (datetmp, 0);
+ send_to_server ("\012", 0);
free (p->end);
+ }
free (p);
}
Index: ccvs/src/logmsg.c
diff -u ccvs/src/logmsg.c:1.101 ccvs/src/logmsg.c:1.102
--- ccvs/src/logmsg.c:1.101 Mon Apr 24 18:50:26 2006
+++ ccvs/src/logmsg.c Thu May 11 17:10:37 2006
@@ -168,7 +168,7 @@
if (tag != NULL)
free (tag);
- tag = xstrdup (li->tag);
+ tag = li->tag ? xstrdup (li->tag) : NULL;
/* Force a new line. */
col = 70;
Index: ccvs/src/vers_ts.c
diff -u ccvs/src/vers_ts.c:1.66 ccvs/src/vers_ts.c:1.67
--- ccvs/src/vers_ts.c:1.66 Mon Apr 24 18:50:27 2006
+++ ccvs/src/vers_ts.c Thu May 11 17:10:37 2006
@@ -53,8 +53,8 @@
char *rcsexpand = NULL;
TRACE (TRACE_FUNCTION, "Version_TS (%s, %s, %s, %s, %d, %d)",
- finfo->fullname, options ? options : "(null)", tag ? tag : "(null)",
- date ? date : "(null)", force_tag_match, set_time);
+ finfo->fullname, TRACE_NULL (options), TRACE_NULL (tag),
+ TRACE_NULL (date), force_tag_match, set_time);
/* get a new Vers_TS struct */
@@ -170,8 +170,8 @@
*/
if (tag || date)
{
- vers_ts->tag = xstrdup (tag);
- vers_ts->date = xstrdup (date);
+ vers_ts->tag = tag ? xstrdup (tag) : NULL;
+ vers_ts->date = date ? xstrdup (date) : NULL;
}
else if (!vers_ts->entdata && (sdtp && sdtp->aflag == 0))
{
@@ -220,7 +220,7 @@
if (vers_ts->vn_rcs == NULL)
vers_ts->vn_tag = NULL;
else if (simple)
- vers_ts->vn_tag = xstrdup (vers_ts->tag);
+ vers_ts->vn_tag = vers_ts->tag ? xstrdup (vers_ts->tag) : NULL;
else
vers_ts->vn_tag = xstrdup (vers_ts->vn_rcs);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cvs-cvs] ccvs/src ChangeLog add.c client.c entries.c log...,
Mark D. Baushke <=