aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/conduit/address-conduit.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-01-16 00:01:35 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-01-16 00:01:35 +0800
commitff3935d0a6e4b639a070f3f980187d4774ca5da8 (patch)
tree1fe8895f7752604646b2af35f3642b1842e2407e /addressbook/conduit/address-conduit.c
parent12d6acd7bcec525403136599c16808d9cbe896e4 (diff)
downloadgsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.gz
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.bz2
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.lz
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.xz
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.tar.zst
gsoc2013-evolution-ff3935d0a6e4b639a070f3f980187d4774ca5da8.zip
'2001-01-15 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (print_local): prevent segfaults and buffer overflows (print_remote): ditto 2001-01-15 JP Rosevear <jpr@ximian.com> * conduits/todo/todo-conduit.c (print_local): prevent segfaults and buffer overflows. (print_remote): ditto * conduits/calendar/calendar-conduit.c: as above svn path=/trunk/; revision=7504
Diffstat (limited to 'addressbook/conduit/address-conduit.c')
-rw-r--r--addressbook/conduit/address-conduit.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
index ee6aa56541..43ba2569e0 100644
--- a/addressbook/conduit/address-conduit.c
+++ b/addressbook/conduit/address-conduit.c
@@ -96,10 +96,13 @@ print_local (EAddrLocalRecord *local)
}
if (local->addr) {
- sprintf (buff, "['%s' '%s' '%s']",
- local->addr->entry[entryLastname],
- local->addr->entry[entryFirstname],
- local->addr->entry[entryCompany]);
+ g_snprintf (buff, 4096, "['%s' '%s' '%s']",
+ local->addr->entry[entryLastname] ?
+ local->addr->entry[entryLastname] : "",
+ local->addr->entry[entryFirstname] ?
+ local->addr->entry[entryFirstname] : "",
+ local->addr->entry[entryCompany] ?
+ local->addr->entry[entryCompany] : "");
return buff;
}
@@ -119,10 +122,13 @@ static char *print_remote (GnomePilotRecord *remote)
memset (&addr, 0, sizeof (struct Address));
unpack_Address (&addr, remote->record, remote->length);
- sprintf (buff, "['%s' '%s' '%s']",
- addr.entry[entryLastname],
- addr.entry[entryFirstname],
- addr.entry[entryCompany]);
+ g_snprintf (buff, 4096, "['%s' '%s' '%s']",
+ addr.entry[entryLastname] ?
+ addr.entry[entryLastname] : "",
+ addr.entry[entryFirstname] ?
+ addr.entry[entryFirstname] : "",
+ addr.entry[entryCompany] ?
+ addr.entry[entryCompany] : "");
return buff;
}