diff options
author | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-06 09:22:54 +0000 |
---|---|---|
committer | Hakan Olsson <ho@cvs.openbsd.org> | 2003-04-06 09:22:54 +0000 |
commit | e96808ab3c78278eb00c2f1c8a0adb341e6030f1 (patch) | |
tree | 833341b6d1be261e6e5dbeb2c1837f375658d61b /lib/libcrypto/engine/eng_ctrl.c | |
parent | 015cd9dd0517c1ff44b61806bb740b9aa9e39c0f (diff) |
sprintf->snprintf. deraadt@ suggestions and ok
Diffstat (limited to 'lib/libcrypto/engine/eng_ctrl.c')
-rw-r--r-- | lib/libcrypto/engine/eng_ctrl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libcrypto/engine/eng_ctrl.c b/lib/libcrypto/engine/eng_ctrl.c index ad3858395be..0d56e69d271 100644 --- a/lib/libcrypto/engine/eng_ctrl.c +++ b/lib/libcrypto/engine/eng_ctrl.c @@ -160,15 +160,19 @@ static int int_ctrl_helper(ENGINE *e, int cmd, long i, void *p, void (*f)()) case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD: return strlen(e->cmd_defns[idx].cmd_name); case ENGINE_CTRL_GET_NAME_FROM_CMD: - return sprintf(s, "%s", e->cmd_defns[idx].cmd_name); + return snprintf(s,strlen(e->cmd_defns[idx].cmd_name) + 1, + "%s", e->cmd_defns[idx].cmd_name); case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD: if(e->cmd_defns[idx].cmd_desc) return strlen(e->cmd_defns[idx].cmd_desc); return strlen(int_no_description); case ENGINE_CTRL_GET_DESC_FROM_CMD: if(e->cmd_defns[idx].cmd_desc) - return sprintf(s, "%s", e->cmd_defns[idx].cmd_desc); - return sprintf(s, "%s", int_no_description); + return snprintf(s, + strlen(e->cmd_defns[idx].cmd_desc) + 1, + "%s", e->cmd_defns[idx].cmd_desc); + return snprintf(s, strlen(int_no_description) + 1,"%s", + int_no_description); case ENGINE_CTRL_GET_CMD_FLAGS: return e->cmd_defns[idx].cmd_flags; } |