Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
1fbdb6bc
Commit
1fbdb6bc
authored
20 years ago
by
Michael Meskes
Browse files
Options
Downloads
Patches
Plain Diff
Fixed segfault in connect when specifying no database name.
parent
c3d583dd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/interfaces/ecpg/ecpglib/connect.c
+86
-81
86 additions, 81 deletions
src/interfaces/ecpg/ecpglib/connect.c
src/interfaces/ecpg/ecpglib/memory.c
+6
-2
6 additions, 2 deletions
src/interfaces/ecpg/ecpglib/memory.c
with
92 additions
and
83 deletions
src/interfaces/ecpg/ecpglib/connect.c
+
86
−
81
View file @
1fbdb6bc
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.2
3
2004/
08/29 05:06:59 momjian
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.2
4
2004/
12/30 09:36:37 meskes
Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include
"postgres_fe.h"
...
...
@@ -242,7 +242,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
struct
sqlca_t
*
sqlca
=
ECPGget_sqlca
();
enum
COMPAT_MODE
compat
=
c
;
struct
connection
*
this
;
char
*
dbname
=
strdup
(
name
),
char
*
dbname
=
name
?
strdup
(
name
)
:
NULL
,
*
host
=
NULL
,
*
tmp
,
*
port
=
NULL
,
...
...
@@ -275,6 +275,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
if
(
dbname
==
NULL
&&
connection_name
==
NULL
)
connection_name
=
"DEFAULT"
;
if
(
dbname
!=
NULL
)
{
/* get the detail information out of dbname */
if
(
strchr
(
dbname
,
'@'
)
!=
NULL
)
{
...
...
@@ -390,6 +392,9 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
}
else
realname
=
strdup
(
dbname
);
}
else
realname
=
NULL
;
/* add connection to our list */
#ifdef ENABLE_THREAD_SAFETY
...
...
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/ecpglib/memory.c
+
6
−
2
View file @
1fbdb6bc
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/memory.c,v 1.
5
200
3
/1
1/29 19:52:08 pgsql
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/memory.c,v 1.
6
200
4
/1
2/30 09:36:37 meskes
Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include
"postgres_fe.h"
...
...
@@ -46,8 +46,12 @@ ECPGrealloc(void *ptr, long size, int lineno)
char
*
ECPGstrdup
(
const
char
*
string
,
int
lineno
)
{
char
*
new
=
strdup
(
string
)
;
char
*
new
;
if
(
string
==
NULL
)
return
NULL
;
new
=
strdup
(
string
);
if
(
!
new
)
{
ECPGraise
(
lineno
,
ECPG_OUT_OF_MEMORY
,
ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
,
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment