Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
69768018
Commit
69768018
authored
Jan 09, 2001
by
Mark Andrews
Browse files
Replace memset() w/ null assignment to last element of array.
the strncpy() fills in the other bytes.
parent
d119051e
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/isc/mem.c
View file @
69768018
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mem.c,v 1.7
6
200
0/12/29 01:02:07 bwelling
Exp $ */
/* $Id: mem.c,v 1.7
7
200
1/01/09 00:39:46 marka
Exp $ */
#include
<config.h>
...
...
@@ -1379,8 +1379,8 @@ isc_mempool_setname(isc_mempool_t *mpctx, const char *name) {
if
(
mpctx
->
lock
!=
NULL
)
LOCK
(
mpctx
->
lock
);
memset
(
mpctx
->
name
,
0
,
sizeof
(
mpctx
->
name
));
strncpy
(
mpctx
->
name
,
name
,
sizeof
(
mpctx
->
name
)
-
1
);
mpctx
->
name
[
sizeof
(
mpctx
->
name
)
-
1
]
=
'\0'
;
if
(
mpctx
->
lock
!=
NULL
)
UNLOCK
(
mpctx
->
lock
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment