Uninitialized memory access in zic

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Uninitialized memory access in zic
Date: 2026-05-29 16:43:32
Message-ID: 4uukubkg3t5eavtxxzfa7smqbnqqvl3ysl7aptmj77zbtdxjh3@krjnfntcirw6
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Valgrind on zic, run during the build, complains about a jump depending on
uninitialized memory. A cursory check seems to confirm that, but I don't
understand the code at all:

valgrind --track-origins=yes src/timezone/zic -d src/timezone/timezone ../../../../../home/andres/src/postgresql/src/timezone/data/tzdata.zi

==3443847== Memcheck, a memory error detector
==3443847== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==3443847== Using Valgrind-3.25.1 and LibVEX; rerun with -h for copyright info
==3443847== Command: src/timezone/zic -d src/timezone/timezone ../../../../../home/andres/src/postgresql/src/timezone/data/tzdata.zi
==3443847==
==3443847== Conditional jump or move depends on uninitialised value(s)
==3443847== at 0x4209F57: writezone (zic.c:2311)
==3443847== by 0x420AC90: outzone (zic.c:3344)
==3443847== by 0x420B65B: main (zic.c:853)
==3443847== Uninitialised value was created by a heap allocation
==3443847== at 0x404A818: malloc (vg_replace_malloc.c:446)
==3443847== by 0x4206A3F: emalloc (zic.c:454)
==3443847== by 0x4208E92: writezone (zic.c:2102)
==3443847== by 0x420AC90: outzone (zic.c:3344)
==3443847== by 0x420B65B: main (zic.c:853)
==3443847==

Greetings,

Andres Freund

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Srinath Reddy Sadipiralla 2026-05-29 16:44:10 Re: Fix race in ReplicationSlotRelease for ephemeral slots
Previous Message Nathan Bossart 2026-05-29 16:42:27 Re: future of PQfn()