Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for directoryOffset (0.74 sec)

  1. src/archive/zip/reader.go

    		}
    	}
    
    	maxInt64 := uint64(1<<63 - 1)
    	if d.directorySize > maxInt64 || d.directoryOffset > maxInt64 {
    		return nil, 0, ErrFormat
    	}
    
    	baseOffset = directoryEndOffset - int64(d.directorySize) - int64(d.directoryOffset)
    
    	// Make sure directoryOffset points to somewhere in our file.
    	if o := baseOffset + int64(d.directoryOffset); o < 0 || o >= size {
    		return nil, 0, ErrFormat
    	}
    
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Tue Mar 11 22:19:38 UTC 2025
    - 28.4K bytes
    - Viewed (0)
  2. src/archive/zip/reader_test.go

    		}
    		if _, err := io.Copy(io.Discard, r); err != nil {
    			t.Fatalf("unexpected error: %v", err)
    		}
    	}
    }
    
    func TestBaseOffsetPlusOverflow(t *testing.T) {
    	// directoryOffset > maxInt64 && size-directoryOffset < 0
    	data := []byte{
    		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Tue Mar 11 22:19:38 UTC 2025
    - 56.6K bytes
    - Viewed (0)
Back to top