Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Interpret only valid entries of internalBuf of DirectoryInputStream
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
  • Loading branch information
BernardMetzler authored and PepperJo committed Jun 24, 2021
1 parent c748a5c commit 5ee9886f2553ce53998bcbcc556637326877c32e
Showing 1 changed file with 8 additions and 4 deletions.
@@ -54,10 +54,14 @@ public void update(CrailBuffer buffer) {
int tmplimit = buffer.position() + CrailConstants.DIRECTORY_RECORD;
buffer.limit(tmplimit);
valid = buffer.getInt();
int length = buffer.getInt();
byte barray[] = new byte[length];
buffer.get(barray);
filename = new String(barray);
if (valid == 1) {
int length = buffer.getInt();
byte barray[] = new byte[length];
buffer.get(barray);
filename = new String(barray);
} else {
filename = null;
}
buffer.position(tmplimit);
buffer.limit(oldlimit);
}

0 comments on commit 5ee9886

Please sign in to comment.