You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "xiaokang (via GitHub)" <gi...@apache.org> on 2024/09/15 02:01:22 UTC
[PR] fix CLStream memcpy read 1 extra byte [doris-thirdparty]
xiaokang opened a new pull request, #240:
URL: https://github.com/apache/doris-thirdparty/pull/240
(no comment)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] fix CLStream memcpy read 1 extra byte [doris-thirdparty]
Posted by "xiaokang (via GitHub)" <gi...@apache.org>.
xiaokang commented on code in PR #240:
URL: https://github.com/apache/doris-thirdparty/pull/240#discussion_r1759963263
##########
src/core/CLucene/util/CLStreams.h:
##########
@@ -207,7 +207,8 @@ class CLUCENE_EXPORT SStringReader : public Reader {
tmp = (T *) realloc(tmp, sizeof(T) * (length + 1));
this->buffer_size = length;
}
- memcpy(tmp, _value, length + 1);
+ memcpy(tmp, _value, length);
Review Comment:
I think we should not do use length * sizeof(T), since the input size is just length. I'll change it to use different way for sizeof(T) == 1 and others.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org
Re: [PR] fix CLStream memcpy read 1 extra byte [doris-thirdparty]
Posted by "airborne12 (via GitHub)" <gi...@apache.org>.
airborne12 commented on code in PR #240:
URL: https://github.com/apache/doris-thirdparty/pull/240#discussion_r1759953844
##########
src/core/CLucene/util/CLStreams.h:
##########
@@ -207,7 +207,8 @@ class CLUCENE_EXPORT SStringReader : public Reader {
tmp = (T *) realloc(tmp, sizeof(T) * (length + 1));
this->buffer_size = length;
}
- memcpy(tmp, _value, length + 1);
+ memcpy(tmp, _value, length);
Review Comment:
memcpy(tmp, _value, length * sizeof(T));
--
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.
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org
Re: [PR] fix CLStream memcpy read 1 extra byte [doris-thirdparty]
Posted by "xiaokang (via GitHub)" <gi...@apache.org>.
xiaokang merged PR #240:
URL: https://github.com/apache/doris-thirdparty/pull/240
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] fix CLStream memcpy read 1 extra byte [doris-thirdparty]
Posted by "xiaokang (via GitHub)" <gi...@apache.org>.
xiaokang commented on code in PR #240:
URL: https://github.com/apache/doris-thirdparty/pull/240#discussion_r1759963263
##########
src/core/CLucene/util/CLStreams.h:
##########
@@ -207,7 +207,8 @@ class CLUCENE_EXPORT SStringReader : public Reader {
tmp = (T *) realloc(tmp, sizeof(T) * (length + 1));
this->buffer_size = length;
}
- memcpy(tmp, _value, length + 1);
+ memcpy(tmp, _value, length);
Review Comment:
I think we should not do use length * sizeof(T), since the input size is just length. I'll change it to use different way for sizeof(T) == 1 and others.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org