[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... [cvs1-11-x-
From: |
Mark D. Baushke |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog add.c client.c entries.c log... [cvs1-11-x-branch] |
Date: |
Thu, 11 May 2006 17:02:05 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Branch: cvs1-11-x-branch
Changes by: Mark D. Baushke <address@hidden> 06/05/11 17:02:04
Modified files:
src : ChangeLog add.c client.c entries.c log.c
logmsg.c vers_ts.c
Log message:
* 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.]
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/ChangeLog.diff?only_with_tag=cvs1-11-x-branch&tr1=1.2336.2.444&tr2=1.2336.2.445&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/add.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.80.2.23&tr2=1.80.2.24&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/client.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.318.4.36&tr2=1.318.4.37&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/entries.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.46.6.4&tr2=1.46.6.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/log.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.79.4.17&tr2=1.79.4.18&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/logmsg.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.62.4.10&tr2=1.62.4.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/vers_ts.c.diff?only_with_tag=cvs1-11-x-branch&tr1=1.43.4.8&tr2=1.43.4.9&r1=text&r2=text
Patches:
Index: ccvs/src/ChangeLog
diff -u ccvs/src/ChangeLog:1.2336.2.444 ccvs/src/ChangeLog:1.2336.2.445
--- ccvs/src/ChangeLog:1.2336.2.444 Wed May 10 02:30:32 2006
+++ ccvs/src/ChangeLog Thu May 11 17:02:04 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-04 Mark D. Baushke <address@hidden>
* filesubr.c (cvs_temp_file): Avoid keeping pointers to free()'d
Index: ccvs/src/add.c
diff -u ccvs/src/add.c:1.80.2.23 ccvs/src/add.c:1.80.2.24
--- ccvs/src/add.c:1.80.2.23 Sun Sep 4 00:41:27 2005
+++ ccvs/src/add.c Thu May 11 17:02:04 2006
@@ -852,7 +852,7 @@
p->key = xstrdup ("- New directory");
li = (struct logfile_info *) 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.318.4.36 ccvs/src/client.c:1.318.4.37
--- ccvs/src/client.c:1.318.4.36 Fri Apr 7 17:16:04 2006
+++ ccvs/src/client.c Thu May 11 17:02:04 2006
@@ -3244,7 +3244,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
@@ -3253,13 +3253,13 @@
else if (importmergecmd.seen)
{
if (strcmp (tag, "conflicts") == 0)
- importmergecmd.conflicts = atoi (text);
+ importmergecmd.conflicts = text ? atoi (text) : -1;
else if (strcmp (tag, "mergetag1") == 0)
- importmergecmd.mergetag1 = xstrdup (text);
+ importmergecmd.mergetag1 = text ? xstrdup (text) : NULL;
else if (strcmp (tag, "mergetag2") == 0)
- importmergecmd.mergetag2 = xstrdup (text);
+ importmergecmd.mergetag2 = text ? xstrdup (text) : NULL;
else if (strcmp (tag, "repository") == 0)
- 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
Index: ccvs/src/entries.c
diff -u ccvs/src/entries.c:1.46.6.4 ccvs/src/entries.c:1.46.6.5
--- ccvs/src/entries.c:1.46.6.4 Wed Mar 9 19:47:14 2005
+++ ccvs/src/entries.c Thu May 11 17:02:04 2006
@@ -59,9 +59,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;
}
@@ -491,8 +491,8 @@
sdtp = (struct stickydirtag *) xmalloc (sizeof (*sdtp));
memset ((char *) 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.79.4.17 ccvs/src/log.c:1.79.4.18
--- ccvs/src/log.c:1.79.4.17 Thu Mar 17 16:31:48 2005
+++ ccvs/src/log.c Thu May 11 17:02:04 2006
@@ -316,17 +316,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 != NULL && p->end != NULL)
+ {
+ 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)
@@ -337,13 +340,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.62.4.10 ccvs/src/logmsg.c:1.62.4.11
--- ccvs/src/logmsg.c:1.62.4.10 Thu May 4 09:53:09 2006
+++ ccvs/src/logmsg.c Thu May 11 17:02:04 2006
@@ -155,7 +155,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.43.4.8 ccvs/src/vers_ts.c:1.43.4.9
--- ccvs/src/vers_ts.c:1.43.4.8 Thu Sep 22 18:13:29 2005
+++ ccvs/src/vers_ts.c Thu May 11 17:02:04 2006
@@ -155,8 +155,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))
{
@@ -200,7 +200,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... [cvs1-11-x-branch],
Mark D. Baushke <=