RFR: 8308071: [REDO] update for deprecated sprintf for src/utils [v2]
Xue-Lei Andrew Fan
xuelei at openjdk.org
Wed May 17 04:17:43 UTC 2023
On Wed, 17 May 2023 03:26:45 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> This and all uses of snprintf in this change are incorrect. If the output is truncated, snprintf returns the number of characters that would have been written if there had been enough space. That is, the result may be larger than bufsize.
The correctness of this change depends on the fact that the buffer has sufficient capacity, which has been checked at line 230. I agreed that this is not a typical use of `snprintf` that the returned value is not checked. I will make an update to check the returned value of `snprintf`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13995#discussion_r1195909903
More information about the build-dev
mailing list