diff --git a/main/pbx.c b/main/pbx.c
index fcf0aa64e806f7afd7de1df706e76c2e8e029942..5e4f0a4db48321de3dcef0002def0e8a26d7a0cc 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7521,7 +7521,7 @@ static char *handle_show_hints(struct ast_cli_entry *e, int cmd, struct ast_cli_
 			continue;
 		}
 		watchers = ao2_container_count(hint->callbacks);
-		sprintf(buf, "%s@%s",
+		snprintf(buf, sizeof(buf), "%s@%s",
 			ast_get_extension_name(hint->exten),
 			ast_get_context_name(ast_get_extension_context(hint->exten)));