pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[patch] CodeGuard fix
5+ messages / 3 participants
[nested] [flat]

* [patch] CodeGuard fix
@ 2003-12-17 09:35 Cyrille Chépélov <cyrille@softek.fr>
  2003-12-17 09:59 ` Re: [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
  0 siblings, 1 reply; 5+ messages in thread

From: Cyrille Chépélov @ 2003-12-17 09:35 UTC (permalink / raw)
  To: pgsql-odbc

Greetings,

the following patch (against 7.03.0200) contains two things:
	- The first hunk is necessary to build psqlodbc using Borland C++ 
Builder 6.0 [I successfully built the whole DLL, which requires a few 
other patches]
	- The second hunk is necessary as Borland's sscanf would do all sorts 
of things with rest[] when CodeGuard is active (I wonder if it's not 
their way of hinting that we have an opportunity for a buffer overrun here).

I wonder if we shouldn't apply a better fix, to avoid entirely the "%s" 
format argument to sscanf, and finding another way to locate a "const 
char* rest" within the caller-supplied str?

Best Regards,
	
	-- Cyrille



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [patch] CodeGuard fix
  2003-12-17 09:35 [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
@ 2003-12-17 09:59 ` Cyrille Chépélov <cyrille@softek.fr>
  2003-12-19 11:52   ` Re: [patch] CodeGuard fix Hiroshi Inoue <inoue@tpf.co.jp>
  2004-04-09 20:43   ` Re: [patch] CodeGuard fix Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 2 replies; 5+ messages in thread

From: Cyrille Chépélov @ 2003-12-17 09:59 UTC (permalink / raw)
  To: pgsql-odbc

Cyrille Chépélov wrote:

> the following patch (against 7.03.0200) contains two things:

Note to self: ensure proper blood caffeine content before sending messages.

	-- Cyrille

Attachments:

convert.c.diff (text/plain, 795B) download --- psqlodbc-07.03.0200.vanilla/convert.c 2003-10-20 04:37:42.000000000 +0200 +++ psqlodbc-07.03.0200/convert.c 2003-12-17 10:24:12.000000000 +0100 @@ -44,9 +44,15 @@ #endif #ifdef __CYGWIN__ -#define TIMEZONE_GLOBAL _timezone +# define TIMEZONE_GLOBAL _timezone #elif defined(WIN32) || defined(HAVE_INT_TIMEZONE) -#define TIMEZONE_GLOBAL timezone +# ifdef __BORLANDC__ +# define timezone _timzone +# define daylight _daylight +# define TIMEZONE_GLOBAL _timezone +# else +# define TIMEZONE_GLOBAL timezone +# endif #endif /* @@ -195,6 +201,7 @@ *zone = 0; st->fr = 0; st->infinity = 0; + rest[0] = 0; if ((scnt = sscanf(str, "%4d-%2d-%2d %2d:%2d:%2d%s", &st->y, &st->m, &st->d, &st->hh, &st->mm, &st->ss, rest)) < 6) return FALSE; else if (scnt == 6)
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: [patch] CodeGuard fix
  2003-12-17 09:35 [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
  2003-12-17 09:59 ` Re: [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
@ 2003-12-19 11:52   ` Hiroshi Inoue <inoue@tpf.co.jp>
  2003-12-22 07:02     ` Re: [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
  1 sibling, 1 reply; 5+ messages in thread

From: Hiroshi Inoue @ 2003-12-19 11:52 UTC (permalink / raw)
  To: 'Cyrille Ch���~ov' <cyrille@softek.fr>; +Cc: pgsql-odbc

> -----Original Message-----
> From: Cyrille Ch���~ov
> 
> Cyrille Chépélov wrote:
> 
> > the following patch (against 7.03.0200) contains two things:
> 
> Note to self: ensure proper blood caffeine content before 
> sending messages.

In your patch

.
.
+#  ifdef __BORLANDC__
+#    define timezone _timzone
+#    define daylight _daylight

What are the above 2 lines for ?

regards,
Hiroshi Inoue




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [patch] CodeGuard fix
  2003-12-17 09:35 [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
  2003-12-17 09:59 ` Re: [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
  2003-12-19 11:52   ` Re: [patch] CodeGuard fix Hiroshi Inoue <inoue@tpf.co.jp>
@ 2003-12-22 07:02     ` Cyrille Chépélov <cyrille@softek.fr>
  0 siblings, 0 replies; 5+ messages in thread

From: Cyrille Chépélov @ 2003-12-22 07:02 UTC (permalink / raw)
  To: Hiroshi Inoue <inoue@tpf.co.jp>; +Cc: pgsql-odbc

Hiroshi Inoue wrote:

> +#  ifdef __BORLANDC__
> +#    define timezone _timzone
> +#    define daylight _daylight
> 
> What are the above 2 lines for ?

Oh, to account for stupid spraying of underscores in Borland's libc.

I can give you a whole BC++ patch if you want -- in my experience with
these 10-30 minutes of effort, the resulting DLL works as fine as if
compiled with VC++.

Best Regards,

	-- Cyrille




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [patch] CodeGuard fix
  2003-12-17 09:35 [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
  2003-12-17 09:59 ` Re: [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
@ 2004-04-09 20:43   ` Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Bruce Momjian @ 2004-04-09 20:43 UTC (permalink / raw)
  To: Cyrille Chépélov <cyrille@softek.fr>; +Cc: pgsql-odbc


Thanks.  Patch applied.

---------------------------------------------------------------------------

Cyrille Chépélov wrote:
> Cyrille Ch?p?lov wrote:
> 
> > the following patch (against 7.03.0200) contains two things:
> 
> Note to self: ensure proper blood caffeine content before sending messages.
> 
> 	-- Cyrille
> 
> 
> 

> --- psqlodbc-07.03.0200.vanilla/convert.c	2003-10-20 04:37:42.000000000 +0200
> +++ psqlodbc-07.03.0200/convert.c	2003-12-17 10:24:12.000000000 +0100
> @@ -44,9 +44,15 @@
>  #endif
>  
>  #ifdef	__CYGWIN__
> -#define TIMEZONE_GLOBAL _timezone
> +#  define TIMEZONE_GLOBAL _timezone
>  #elif	defined(WIN32) || defined(HAVE_INT_TIMEZONE)
> -#define TIMEZONE_GLOBAL timezone
> +#  ifdef __BORLANDC__
> +#    define timezone _timzone
> +#    define daylight _daylight
> +#    define TIMEZONE_GLOBAL _timezone
> +#  else
> +#    define TIMEZONE_GLOBAL timezone
> +#  endif
>  #endif
>  
>  /*
> @@ -195,6 +201,7 @@
>  	*zone = 0;
>  	st->fr = 0;
>  	st->infinity = 0;
> +        rest[0] = 0;
>  	if ((scnt = sscanf(str, "%4d-%2d-%2d %2d:%2d:%2d%s", &st->y, &st->m, &st->d, &st->hh, &st->mm, &st->ss, rest)) < 6)
>  		return FALSE;
>  	else if (scnt == 6)
> 

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2004-04-09 20:43 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-12-17 09:35 [patch] CodeGuard fix Cyrille Chépélov <cyrille@softek.fr>
2003-12-17 09:59 ` Cyrille Chépélov <cyrille@softek.fr>
2003-12-19 11:52   ` Hiroshi Inoue <inoue@tpf.co.jp>
2003-12-22 07:02     ` Cyrille Chépélov <cyrille@softek.fr>
2004-04-09 20:43   ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox