[pve-devel] [PATCH storage] fix use of uninitialized value in parse_ceph_config

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Jan 3 09:26:02 CET 2019


On Wed, Jan 02, 2019 at 12:17:35PM +0100, David Limbeck wrote:
> Signed-off-by: David Limbeck <d.limbeck at proxmox.com>
> ---
>  PVE/CephConfig.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/PVE/CephConfig.pm b/PVE/CephConfig.pm
> index 5b2d19e..3f06242 100644
> --- a/PVE/CephConfig.pm
> +++ b/PVE/CephConfig.pm
> @@ -15,6 +15,7 @@ sub parse_ceph_config {
>  
>      my $cfg = {};
>  
> +    $raw = '' if !defined($raw);

Since we're then effectively parsing an empty string, this could just
return the empty $cfg from above directly, no?

>      my @lines = split /\n/, $raw;
>  
>      my $section;
> -- 
> 2.11.0




More information about the pve-devel mailing list