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

Commitd934a05

Browse files
committed
Fix uninitialized-variable warning.
In passing, add an Assert defending the presumption that bytes_leftis positive to start with. (I'm not exactly convinced that using anunsigned type was such a bright thing here, but let's at least dothis much.)
1 parentaedccb1 commitd934a05

File tree

1 file changed

+4
-2
lines changed
  • src/backend/utils/misc

1 file changed

+4
-2
lines changed

‎src/backend/utils/misc/guc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8741,9 +8741,10 @@ SerializeGUCState(Size maxsize, char *start_address)
87418741
Sizeactual_size;
87428742
Sizebytes_left;
87438743
inti;
8744-
inti_role;
8744+
inti_role=-1;
87458745

87468746
/* Reserve space for saving the actual size of the guc state */
8747+
Assert(maxsize>sizeof(actual_size));
87478748
curptr=start_address+sizeof(actual_size);
87488749
bytes_left=maxsize-sizeof(actual_size);
87498750

@@ -8759,7 +8760,8 @@ SerializeGUCState(Size maxsize, char *start_address)
87598760
else
87608761
serialize_variable(&curptr,&bytes_left,guc_variables[i]);
87618762
}
8762-
serialize_variable(&curptr,&bytes_left,guc_variables[i_role]);
8763+
if (i_role >=0)
8764+
serialize_variable(&curptr,&bytes_left,guc_variables[i_role]);
87638765

87648766
/* Store actual size without assuming alignment of start_address. */
87658767
actual_size=maxsize-bytes_left-sizeof(actual_size);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp