[Freeipa-devel] [PATCH] create tmp directory for ipa-kpasswd

Simo Sorce ssorce at redhat.com
Fri May 2 12:48:45 UTC 2008


On Fri, 2008-05-02 at 18:38 +0900, Masato Taruishi wrote:
> +       tmp_file = (char
> *)malloc(strlen(cachedir)+strlen(TMP_TEMPLATE)+2);
>         if (!tmp_file) {
>                 syslog(LOG_ERR, "Out of memory!");
>                 ret = KRB5_KPASSWD_HARDERROR;
>                 goto done;
>         }
> +       strcpy( tmp_file, cachedir );
> +       strcat( tmp_file, "/" );
> +       strcat( tmp_file, TMP_TEMPLATE );


Change all this with:
asprintf(&tmp_file, "%s/%s", cachedir, TMP_TEMPLATE);

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the Freeipa-devel mailing list