From d296223ffe0abd95df5cfd611fc746ebaa669048 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Wed, 26 Oct 2011 15:59:27 +0200 Subject: [PATCH] cuda: Suppress sprintf usage. --- src/util-cuda-handlers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util-cuda-handlers.c b/src/util-cuda-handlers.c index a62a987a54..dfa5b7ab83 100644 --- a/src/util-cuda-handlers.c +++ b/src/util-cuda-handlers.c @@ -486,7 +486,8 @@ int SCCudaHlGetCudaModule(CUmodule *p_module, const char *ptx_image, int handle) minor = devices->devices[i]->minor_rev; } } - sprintf(image, "%s_sm_%u%u", ptx_image, major, minor); + snprintf(image, strlen(ptx_image) + 15, "%s_sm_%u%u", + ptx_image, major, minor); /* we don't have a cuda module associated with this module. Create a * cuda module, update the module with this cuda module reference and