pjstevns/dbmail — pull request #7 by santa01 (2013-10-16 07:59:09+00:00)
Title: Copy header values into a NULL-terminated buffer

Blob buffer returned by db_result_get_blob() cannot be used as a C-string
at least for Oracle DB:

1. libzdb reuses its ResultSet internal buffer allocated for blobs, hence
it possible to read over the blob length and get blob data remnants from
the previous ResultSet_getBlob() call. e.g.:

> [(Date To Cc From Subject X-Priority Importance Priority Content-Type)]
> [Date: Tue, 15 Oct 2013 14:33:12 +0200 (CEST)
> To: santa15 Oct 2013 14:33:12 +0200 (CEST)
> From: 000123125@bgum.portaone.com0200 (CEST)
> Subject: 111222 333444m.portaone.com0200 (CEST)
> X-priority: 3 (Normal)444m.portaone.com0200 (CEST)
> Importance: Normalmal)444m.portaone.com0200 (CEST)]

2. blob length is not taken into account, there is no guarantee blob buffer
is null terminated.