diff options
author | Michael Meskes <meskes@postgresql.org> | 2006-08-18 16:30:53 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2006-08-18 16:30:53 +0000 |
commit | 46d61eb218824cbcc7c21983d7f3452bf56f018a (patch) | |
tree | ce9c7d30cc037da4c7f2a61ae39da5088993e4fa /src/interfaces/ecpg/test | |
parent | 121dd1cdf56f97ebd67ce4c3ae144a3e6b43a750 (diff) | |
download | postgresql-46d61eb218824cbcc7c21983d7f3452bf56f018a.tar.gz postgresql-46d61eb218824cbcc7c21983d7f3452bf56f018a.zip |
Fixed a buffer overrun that was masked on Linux systems.
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r-- | src/interfaces/ecpg/test/complex/test4.pgc | 2 | ||||
-rw-r--r-- | src/interfaces/ecpg/test/expected/complex-test4.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/test/complex/test4.pgc b/src/interfaces/ecpg/test/complex/test4.pgc index 68a64c79acb..4be713b2fda 100644 --- a/src/interfaces/ecpg/test/complex/test4.pgc +++ b/src/interfaces/ecpg/test/complex/test4.pgc @@ -27,7 +27,7 @@ EXEC SQL BEGIN DECLARE SECTION; int *did = &i; int a[10] = {9,8,7,6,5,4,3,2,1,0}; char text[25] = "klmnopqrst"; - char *t = (char *)malloc(10); + char *t = (char *)malloc(11); double f; bool b = true; EXEC SQL END DECLARE SECTION; diff --git a/src/interfaces/ecpg/test/expected/complex-test4.c b/src/interfaces/ecpg/test/expected/complex-test4.c index caf3f4f9fb3..9ac0fe0d25c 100644 --- a/src/interfaces/ecpg/test/expected/complex-test4.c +++ b/src/interfaces/ecpg/test/expected/complex-test4.c @@ -140,7 +140,7 @@ main (void) char text [ 25 ] = "klmnopqrst" ; #line 30 "test4.pgc" - char * t = ( char * ) malloc ( 10 ) ; + char * t = ( char * ) malloc ( 11 ) ; #line 31 "test4.pgc" double f ; @@ -184,14 +184,14 @@ if (sqlca.sqlcode < 0) sqlprint();} #line 46 "test4.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( f , i , a , text , b , t , err ) values( 404.90 , 3 , '{0,1,2,3,4,5,6,7,8,9}' , 'abcdefghij' , 'f' , 0 , 0 )", ECPGt_EOIT, ECPGt_EORT); + { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( f , i , a , text , b , t , err ) values( 404.90 , 3 , '{0,1,2,3,4,5,6,7,8,9}' , 'abcdefghij' , 'f' , 0 , 0 ) ", ECPGt_EOIT, ECPGt_EORT); #line 48 "test4.pgc" if (sqlca.sqlcode < 0) sqlprint();} #line 48 "test4.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( f , i , a , text , b , t , err ) values( 140787.0 , 2 , ? , ? , 't' , 2 , 14 )", + { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( f , i , a , text , b , t , err ) values( 140787.0 , 2 , ? , ? , 't' , 2 , 14 ) ", ECPGt_int,(a),(long)1,(long)10,sizeof(int), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_char,(text),(long)25,(long)1,(25)*sizeof(char), @@ -205,7 +205,7 @@ if (sqlca.sqlcode < 0) sqlprint();} - { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( f , i , a , text , b , t , err ) values( 14.07 , ? , ? , ? , ? , 1 , 147 )", + { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( f , i , a , text , b , t , err ) values( 14.07 , ? , ? , ? , ? , 1 , 147 ) ", ECPGt_int,&(did),(long)1,(long)0,sizeof(int), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_int,(a),(long)1,(long)10,sizeof(int), |