Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d05627

Browse files
committed
Fix "ignoring return value" complaints from commit96d1f42
The cfbot and some BF animals are complaining about the previousread_binary_file commit because of ignoring return value of ‘fread’.So let's make everyone happy by testing the return value even thoughnot strictly needed.Reported by Justin Pryzby, and suggested patch by Tom Lane. Backpatchedto v11 same as the previous commit.Reported-By: Justin PryzbyReviewed-By: Tom LaneDiscussion:https://postgr.es/m/flat/969b8d82-5bb2-5fa8-4eb1-f0e685c5d736%40joeconway.comBackpatch-through: 11
1 parent96d1f42 commit1d05627

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/backend/utils/adt/genfile.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ read_binary_file(const char *filename, int64 seek_offset, int64 bytes_to_read,
168168
{
169169
charrbuf[1];
170170

171-
fread(rbuf,1,1,file);
172-
if (!feof(file))
171+
if (fread(rbuf,1,1,file)!=0|| !feof(file))
173172
ereport(ERROR,
174173
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
175174
errmsg("file length too large")));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp