Code Monkey home page Code Monkey logo

Comments (3)

gbrooker avatar gbrooker commented on June 12, 2024

Output of the above test:

Test Suite 'Selected tests' started at 2019-04-03 00:19:43.016
Test Suite 'HAPTests.xctest' started at 2019-04-03 00:19:43.017
Test Suite 'CryptographerTests' started at 2019-04-03 00:19:43.017
Test Case '-[HAPTests.CryptographerTests testCrash]' started.
[hap.encryption|DEBUG] Shared key: 0000000000000000000000000000000000000000000000000000000000000000
[hap.encryption|DEBUG] Decrypt key: cdfb01cb7dc4e38a05503200ffb9c67cc4ad4904b6bf.......
[hap.encryption|DEBUG] Encrypt key: 581cf63d183319a7a0bacc420a250641567d9772488c850......
[hap.encryption|INFO] Encrypt message #0, length: 494
Passed for 494 bytes

[hap.encryption|INFO] Encrypt message #1, length: 497
Passed for 497 bytes

[hap.encryption|INFO] Encrypt message #2, length: 495
Precondition failed: new writerIndex: 513, expected: range(0, 512): file /Users/guy/Documents/macOS-Dev/HomeKit/HAP/.build/checkouts/swift-nio.git--6096836136898517704/Sources/NIO/ByteBuffer-core.swift, line 795
2019-04-03 00:19:43.118286+0800 xctest[35480:2347171] Precondition failed: new writerIndex: 513, expected: range(0, 512): file /Users/guy/Documents/macOS-Dev/HomeKit/HAP/.build/checkouts/swift-nio.git--6096836136898517704/Sources/NIO/ByteBuffer-core.swift, line 795
Program ended with exit code: 9

from hap.

Bouke avatar Bouke commented on June 12, 2024

Ah yes, this was caused by the buffer not having the right capacity. On entering that method, 2 bytes already had been written; so whenever the requested capacity would be BUCKET_SIZE or BUCKET_SIZE-1, it would result in an buffer overflow. This should be fixed in master in 0cda018.

from hap.

gbrooker avatar gbrooker commented on June 12, 2024

Excellent, fix works perfectly.

from hap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.