H-uru / dirtsand

The D'ni in Real-Time Server and Network Dæmon
GNU Affero General Public License v3.0
35 stars 24 forks source link

Fix a compatibility issue with the Sha0 hashing for usernames and passwords. #180

Closed zrax closed 1 year ago

zrax commented 1 year ago

The original client code would only write the trailing nul character when the copied string had a non-zero length. Furthermore, the DirtSand code could attempt to write the trailing nul outside the buffer, which is dangerous! This fixes both issues by only writing the trailing nul when the strings are non-empty.