mirror of
https://github.com/postgres/postgres.git
synced 2026-02-15 00:33:54 -05:00
Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source so that any overrun is not really a security issue. Nonetheless it seems prudent to forestall any risk by using strlcpy() and similar functions. Fixes by Peter Eisentraut and Jozef Mlich based on Coverity reports. In addition, fix a potential null-pointer-dereference crash in contrib/chkpass. The crypt(3) function is defined to return NULL on failure, but chkpass.c didn't check for that before using the result. The main practical case in which this could be an issue is if libc is configured to refuse to execute unapproved hashing algorithms (e.g., "FIPS mode"). This ideally should've been a separate commit, but since it touches code adjacent to one of the buffer overrun changes, I included it in this commit to avoid last-minute merge issues. This issue was reported by Honza Horak. Security: CVE-2014-0065 for buffer overruns, CVE-2014-0066 for crypt() |
||
|---|---|---|
| .. | ||
| data | ||
| tznames | ||
| .gitignore | ||
| ialloc.c | ||
| known_abbrevs.txt | ||
| localtime.c | ||
| Makefile | ||
| pgtz.c | ||
| pgtz.h | ||
| private.h | ||
| README | ||
| scheck.c | ||
| strftime.c | ||
| tzfile.h | ||
| zic.c | ||
src/timezone/README Timezone ======== This is a PostgreSQL adapted version of the timezone library from http://www.iana.org/time-zones The source code can be found at: ftp://ftp.iana.org/tz/releases/tzcode*.tar.gz The code is currently synced with release 2010c. There are many cosmetic (and not so cosmetic) differences from the original tzcode library, but diffs in the upstream version should usually be propagated to our version. The data files under data/ are an exact copy of the latest data set from: ftp://ftp.iana.org/tz/releases/tzdata*.tar.gz Since time zone rules change frequently in some parts of the world, we should endeavor to update the data files before each PostgreSQL release. While the files under data/ can just be duplicated when updating, manual effort is needed to update the time zone abbreviation lists under tznames/. These need to be changed whenever new abbreviations are invented or the UTC offset associated with an existing abbreviation changes. To detect if this has happened, after installing new files under data/ do make abbrevs.txt which will produce a file showing all abbreviations that are in current use according to the data/ files. Compare this to known_abbrevs.txt, which is the list that existed last time the tznames/ files were updated. Update tznames/ as seems appropriate, then replace known_abbrevs.txt in the same commit. When there has been a new release of Windows (probably including Service Packs), the list of matching timezones need to be updated. Run the script in src/tools/win32tzlist.pl on a Windows machine running this new release and apply any new timezones that it detects. Never remove any mappings in case they are removed in Windows, since we still need to match properly on the old version.