stream-ssl: Avoid access-after-free error in update_ssl_config().
authorBen Pfaff <blp@nicira.com>
Wed, 14 Apr 2010 23:02:38 +0000 (16:02 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 14 Apr 2010 23:02:45 +0000 (16:02 -0700)
commit2b1a27a1f834fd5f02cd1c376769bf5450805983
treede4fcdab0c72b78150e386a0c3eaaa7e2e15940c
parent80bc2072c0f8b105142f7f30f202809127af87a5
stream-ssl: Avoid access-after-free error in update_ssl_config().

Commit b84f503d "stream-ssl: Read existing CA certificate more eagerly
during bootstrap" inadvertently introduced an access-after-free error:

  do_ca_cert_bootstrap() calls
    stream_ssl_set_ca_cert_file(ca_cert.file_name, true), which calls
      update_ssl_config(&ca_cert, file_name), which calls
        free(ca_cert.file_name) then xstrdup(ca_cert.file_name).

Fix the problem.

Reported-by: Cedric Hobbs <cedric@nicira.com>
Reported-by: Peter Balland <peter@nicira.com>
lib/stream-ssl.c