Skip to content

Commit d314616

Browse files
author
Michael Meskes
committed
Fixed segfault due to freeing a struct definition twice if it was a named struct used in a typedef.
1 parent fe30edb commit d314616

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,3 +1895,8 @@ Mon Jan 10 13:55:32 CET 2005
18951895
- Set compat library version to 1.2.
18961896
- Set ecpg library version to 4.2.
18971897

1898+
Tue Jan 25 13:47:45 CET 2005
1899+
1900+
- Fixed segfault in preprocessor due to free a struct twice.
1901+
- Set ecpg version to 3.2.1.
1902+

src/interfaces/ecpg/preproc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2005, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.111 2005/01/18 05:00:28 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.112 2005/01/25 12:51:31 meskes Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -14,8 +14,8 @@ top_builddir = ../../../..
1414
include $(top_builddir)/src/Makefile.global
1515

1616
MAJOR_VERSION=3
17-
MINOR_VERSION=3
18-
PATCHLEVEL=0
17+
MINOR_VERSION=2
18+
PATCHLEVEL=1
1919

2020
override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \
2121
-DMAJOR_VERSION=$(MAJOR_VERSION) \

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.303 2005/01/10 12:58:30 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.304 2005/01/25 12:51:31 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -4690,7 +4690,7 @@ type_declaration: S_TYPEDEF
46904690
this->type->type_index = length; /* length of string */
46914691
this->type->type_sizeof = ECPGstruct_sizeof;
46924692
this->struct_member_list = ($3.type_enum == ECPGt_struct || $3.type_enum == ECPGt_union) ?
4693-
struct_member_list[struct_level] : NULL;
4693+
ECPGstruct_member_dup(struct_member_list[struct_level]) : NULL;
46944694

46954695
if ($3.type_enum != ECPGt_varchar &&
46964696
$3.type_enum != ECPGt_char &&
@@ -5556,7 +5556,7 @@ ECPGTypedef: TYPE_P
55565556
this->type->type_index = length; /* length of string */
55575557
this->type->type_sizeof = ECPGstruct_sizeof;
55585558
this->struct_member_list = ($5.type_enum == ECPGt_struct || $5.type_enum == ECPGt_union) ?
5559-
struct_member_list[struct_level] : NULL;
5559+
ECPGstruct_member_dup(struct_member_list[struct_level]) : NULL;
55605560

55615561
if ($5.type_enum != ECPGt_varchar &&
55625562
$5.type_enum != ECPGt_char &&

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy