]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Properly terminate secrets
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 13 Aug 2018 08:35:37 +0000 (10:35 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Aug 2018 15:11:16 +0000 (17:11 +0200)
commitbfd91dc0c40019c4b543bb704a7391faca0e1bc8
treebf42ebc937b8cec4733b261af3e330fb61482434
parente3e48d7cb82d58865548a6ba78ba88a1e6eedbb1
storage: Properly terminate secrets

The virSecretGetSecretString() helper looks up a secret for given
pool and returns its value in @secret_value and its length in
@secret_value_size. However, the trailing '\0' is not included in
either of the variables. This is because usually the value of the
secret is passed to some encoder (usually base64 encoder) where
the trailing zero must not be accounted for.

However, in two places we actually want the string as we don't
process it any further.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/storage/storage_backend_iscsi.c
src/storage/storage_backend_iscsi_direct.c