CCSDS File Delivery Protocol (CCSDS 727.0-B-5) for space file transfer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

irmin: proof.subheap is a Heap.t, not a block list

+15 -8
+14 -7
lib/cfdp.ml
··· 1229 1229 let cksum = Int32.of_int pe.pe_checksum in 1230 1230 let fsize = be_bytes_to_int64 pe.pe_file_size in 1231 1231 let fss_end = off + 1 + 1 + 4 + fss_len in 1232 - (* Parse fault location TLV if present *) 1232 + (* Parse fault location TLV if present. 1233 + TLV format: type(1) | length(1) | value(length). 1234 + Type 0x06 = Entity ID. Value is 1-8 bytes big-endian. *) 1233 1235 let floc, consumed = 1234 1236 if 1235 1237 len > fss_end - off 1236 - && fss_end < String.length buf 1238 + && fss_end + 1 < String.length buf 1237 1239 && Char.code buf.[fss_end] = 0x06 1238 1240 then begin 1239 1241 let tlv_len = Char.code buf.[fss_end + 1] in 1240 - if tlv_len = 8 then 1241 - let raw = 1242 - be_bytes_to_int64 (String.sub buf (fss_end + 2) 8) 1243 - in 1242 + if 1243 + tlv_len >= 1 && tlv_len <= 8 1244 + && fss_end + 2 + tlv_len <= String.length buf 1245 + then ( 1246 + (* Zero-extend to 8 bytes then parse as big-endian int64 *) 1247 + let padded = Bytes.make 8 '\x00' in 1248 + Bytes.blit_string buf (fss_end + 2) padded (8 - tlv_len) 1249 + tlv_len; 1250 + let raw = be_bytes_to_int64 (Bytes.to_string padded) in 1244 1251 match Entity_id.of_int64_unsigned raw with 1245 1252 | `Ok eid -> (Some eid, fss_end + 2 + tlv_len - off) 1246 - | `Overflow -> (None, fss_end - off) 1253 + | `Overflow -> (None, fss_end - off)) 1247 1254 else (None, fss_end - off) 1248 1255 end 1249 1256 else (None, fss_end - off)
+1 -1
test/interop/spacepackets/traces/eof.csv
··· 10 10 eof_checksum_zero,eof,1,2,3,1,1,toward_receiver,unack,no_error,00000000,256,False,,24000a0001030204000000000000000100 11 11 eof_checksum_ones,eof,1,2,4,1,1,toward_receiver,unack,no_error,ffffffff,512,False,,24000a000104020400ffffffff00000200 12 12 eof_empty_file,eof,1,2,5,1,1,toward_receiver,unack,no_error,abcdef01,0,False,,24000a000105020400abcdef0100000000 13 - eof_fault_location,eof,1,2,6,1,1,toward_receiver,unack,cancel_received,00000000,0,False,255,24000e0001060204f00000000000000000060200ff 13 + eof_fault_location,eof,1,2,6,1,1,toward_receiver,unack,cancel_received,00000000,0,False,42,24000d0001060204f0000000000000000006012a 14 14 eof_large_file_big,eof,1,2,7,1,1,toward_receiver,unack,no_error,deadc0de,72057594037927935,True,,25000e000107020400deadc0de00ffffffffffffff