Skip to content

Commit

Permalink
Bug fix for FirebirdSQL#7599 - the scope of a local buffer in decFina…
Browse files Browse the repository at this point in the history
…lize was corrected
  • Loading branch information
dmitry-lipetsk committed May 29, 2023
1 parent 7fb0b21 commit 388a695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extern/decNumber/decCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ static decFloat * decFinalize(decFloat *df, bcdnum *num,
uByte *ulsd=num->lsd; // ..
uInt encode; // encoding accumulator
Int length; // coefficient length
uByte buffer[ROUNDUP(DECPMAX+3, 4)]; // [+3 allows uInt padding]

#if DECCHECK
Int clen=ulsd-umsd+1;
Expand Down Expand Up @@ -458,7 +459,6 @@ static decFloat * decFinalize(decFloat *df, bcdnum *num,
// fold down needed; must copy to buffer in order to pad
// with zeros safely; fortunately this is not the worst case
// path because cannot have had a round
uByte buffer[ROUNDUP(DECPMAX+3, 4)]; // [+3 allows uInt padding]
uByte *s=umsd; // source
uByte *t=buffer; // safe target
uByte *tlsd=buffer+(ulsd-umsd)+shift; // target LSD
Expand Down

0 comments on commit 388a695

Please sign in to comment.