On 26.11.2013 16:43, Simo Sorce wrote:
On Tue, 2013-11-26 at 16:38 +0100, Jan Cholasta wrote:
- pdc_name = talloc_asprintf(nlr, "\\\\%s", fq_hostname);
+ snprintf(pdc_name, 16, "\\\\%s", fq_hostname);
+ pdc_name[15] = '\0';
It's simpler to use length qualifiers in talloc_asprintf:
pdc_name = talloc_asprintf(nlr, "\\\\%.*s", 15, fq_hostname);
Thanks, I didn't know about that.
--
Jan Cholasta
_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel