mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-14 08:13:25 +02:00
As a failsafe measure use memcpy instead of strcpy in gnupg_copy_time.
Typo fix.
This commit is contained in:
parent
49b2db7636
commit
b11af4cf50
@ -1,3 +1,7 @@
|
|||||||
|
2008-06-05 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* util.h (gnupg_copy_time): Replace strcpy by memcpy.
|
||||||
|
|
||||||
2008-05-26 Werner Koch <wk@g10code.com>
|
2008-05-26 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* asshelp.c (send_one_option, send_pinentry_environment): use
|
* asshelp.c (send_one_option, send_pinentry_environment): use
|
||||||
|
@ -402,7 +402,7 @@ days_per_month (int y, int m)
|
|||||||
|
|
||||||
|
|
||||||
/* Convert YEAR, MONTH and DAY into the Julian date. We assume that
|
/* Convert YEAR, MONTH and DAY into the Julian date. We assume that
|
||||||
it is already noon; we dont; support dates before 1582-10-15. */
|
it is already noon. We do not support dates before 1582-10-15. */
|
||||||
static unsigned long
|
static unsigned long
|
||||||
date2jd (int year, int month, int day)
|
date2jd (int year, int month, int day)
|
||||||
{
|
{
|
||||||
|
@ -115,13 +115,19 @@ gpg_error_t add_days_to_isotime (gnupg_isotime_t atime, int ndays);
|
|||||||
gpg_error_t check_isotime (const gnupg_isotime_t atime);
|
gpg_error_t check_isotime (const gnupg_isotime_t atime);
|
||||||
|
|
||||||
/* Copy one ISO date to another, this is inline so that we can do a
|
/* Copy one ISO date to another, this is inline so that we can do a
|
||||||
sanity check. */
|
minimal sanity check. A null date (empty string) is allowed. */
|
||||||
static inline void
|
static inline void
|
||||||
gnupg_copy_time (gnupg_isotime_t d, const gnupg_isotime_t s)
|
gnupg_copy_time (gnupg_isotime_t d, const gnupg_isotime_t s)
|
||||||
{
|
{
|
||||||
if (*s && (strlen (s) != 15 || s[8] != 'T'))
|
if (*s)
|
||||||
|
{
|
||||||
|
if ((strlen (s) != 15 || s[8] != 'T'))
|
||||||
BUG();
|
BUG();
|
||||||
strcpy (d, s);
|
memcpy (d, s, 15);
|
||||||
|
d[15] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*d = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user