File tree Expand file tree Collapse file tree 3 files changed +21
-12
lines changed
src/main/java/com/maxmind/db Expand file tree Collapse file tree 3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,17 @@ notifications:
16161717 on_success : change
1818 on_failure : always
19+
20+ env :
21+ global :
22+ - secure : " KXF3RVBZDxeASAnleYlTaqvxRRB9FSzSAdVV9h7Kw81+p4UO64b8CPJR1p4fLIVwAp8C4R8h0xZDN3pAv/iyeA4ndIeh9tQXNZBm737RE5x+6x6nf/shP/Em1w9T1s3KmretXoTFK5NJGv2yTesgaIAV/JV1OFvlG6ArswhrPFc="
23+
24+ addons :
25+ coverity_scan :
26+ project :
27+ name : " maxmind/MaxMind-DB-Reader-java"
28+ description : " Build submitted via Travis CI"
29+ notification_email :
[email protected] 30+ build_command_prepend : " mvn clean"
31+ build_command : " mvn -DskipTests=true compile"
32+ branch_pattern : .*coverity.*
Original file line number Diff line number Diff line change @@ -22,7 +22,11 @@ final class BufferHolder {
2222 final FileChannel channel = file .getChannel ();
2323 if (mode == FileMode .MEMORY ) {
2424 this .buffer = ByteBuffer .wrap (new byte [(int ) channel .size ()]);
25- channel .read (this .buffer );
25+ if (channel .read (this .buffer ) != this .buffer .capacity ()) {
26+ throw new IOException ("Unable to read "
27+ + database .getName ()
28+ + " into memory. Unexpected end of stream." );
29+ }
2630 } else {
2731 this .buffer = channel .map (MapMode .READ_ONLY , 0 , channel .size ());
2832 }
Original file line number Diff line number Diff line change 77
88import com .fasterxml .jackson .databind .JsonNode ;
99import com .fasterxml .jackson .databind .ObjectMapper ;
10- import com .fasterxml .jackson .databind .node .ArrayNode ;
11- import com .fasterxml .jackson .databind .node .BigIntegerNode ;
12- import com .fasterxml .jackson .databind .node .BinaryNode ;
13- import com .fasterxml .jackson .databind .node .BooleanNode ;
14- import com .fasterxml .jackson .databind .node .DoubleNode ;
15- import com .fasterxml .jackson .databind .node .FloatNode ;
16- import com .fasterxml .jackson .databind .node .IntNode ;
17- import com .fasterxml .jackson .databind .node .LongNode ;
18- import com .fasterxml .jackson .databind .node .ObjectNode ;
19- import com .fasterxml .jackson .databind .node .TextNode ;
10+ import com .fasterxml .jackson .databind .node .*;
2011
2112/*
2213 * Decoder for MaxMind DB data.
@@ -55,7 +46,7 @@ public static Type fromControlByte(int b) {
5546 }
5647 }
5748
58- class Result {
49+ static class Result {
5950 private final JsonNode node ;
6051 private int offset ;
6152
You can’t perform that action at this time.
0 commit comments