[Commits] [wesnoth/wesnoth] 7b9292: Fix unbound memory read (bug #23606)

GitHub noreply at github.com
Tue Jun 2 22:24:11 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 7b92923555478998d04cdb71d41b2fe3e74e114a
      https://github.com/wesnoth/wesnoth/commit/7b92923555478998d04cdb71d41b2fe3e74e114a
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2015-06-02 (Tue, 02 Jun 2015)

  Changed paths:
    M changelog
    M src/game_initialization/create_engine.cpp
    M src/game_initialization/create_engine.hpp
    M src/hash.hpp

  Log Message:
  -----------
  Fix unbound memory read (bug #23606)

This was introduced in commit 8e5eb9a8d4edf8da33dd19540495b6aa60b28375,
probably because it's not clear enough in our implementation of MD5 that
the result of MD5::raw_digest() (and util::md5() by proxy) is not a
null-terminated string. I've added a comment to util::md5() to clarify
this in case it comes up again, but what we really should do is replace
the MD5 implementation with something a bit more C++-ish.

Fixed the issue by having the caller request the text representation of
the MD5 digest instead.





More information about the Commits mailing list