Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the name of the gremlin request less than 256 bytes #313

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

Linary
Copy link
Contributor

@Linary Linary commented Jan 3, 2019

Change-Id: I46ccdffd92087b50676e1612226424208f66dbee

byte[] srcBytes = firstLine.getBytes(CHARSET);
if (srcBytes.length > MAX_NAME_LENGTH) {
byte[] dstBytes = new byte[MAX_NAME_LENGTH];
System.arraycopy(srcBytes, 0, dstBytes, 0, MAX_NAME_LENGTH);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may cause encoding exception if the end byte is truncated
see: decoder.onMalformedInput(CodingErrorAction.IGNORE);

} else {
return firstLine;
}
} catch (CharacterCodingException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just catch line 175

Change-Id: I46ccdffd92087b50676e1612226424208f66dbee
@javeme javeme merged commit 38da625 into master Jan 7, 2019
@javeme javeme deleted the gremlin-name branch January 7, 2019 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants