adamdebreceni commented on a change in pull request #1036:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1036#discussion_r599577461
##########
File path: extensions/jni/jvm/JniReferenceObjects.h
##########
@@ -142,7 +142,7 @@ class JniByteInputStream : public
minifi::InputStreamCallback {
int read = 0;
do {
- int actual = (int) stream_->read(buffer_, remaining <= buffer_size_ ?
remaining : buffer_size_);
+ int actual = (int) stream_->read(buffer_,
gsl::narrow<uint64_t>(remaining) <= buffer_size_ ? remaining : buffer_size_);
Review comment:
we could introduce the cast a few lines above:
`uint64_t remaining = gsl::narrow<uint64_t>(size);`
```suggestion
int actual = stream_->read(buffer_, std::min(remaining, buffer_size_));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]