2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

2689. [bug] Correctly handle snprintf result. [RT #20306]

This commit is contained in:
Mark Andrews
2009-09-24 22:19:08 +00:00
parent c59a7b0629
commit 0f869e8d52
2 changed files with 5 additions and 1 deletions

View File

@@ -31,7 +31,7 @@
/*
* Principal Author: Brian Wellington
* $Id: dst_api.c,v 1.31 2009/09/23 16:01:57 each Exp $
* $Id: dst_api.c,v 1.32 2009/09/24 22:19:08 marka Exp $
*/
/*! \file */
@@ -1508,6 +1508,8 @@ addsuffix(char *filename, unsigned int len, const char *odirname,
n = snprintf(filename, len, "%s/%.*s%s",
odirname, olen, ofilename, suffix);
if (n < 0)
return (ISC_R_FAILURE);
if (n >= len)
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
}