Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace sprintf by snprintf.
[simgrid.git] / src / xbt / mmalloc / mmorecore.c
index c80e74f..5227d08 100644 (file)
@@ -124,7 +124,7 @@ void *mmorecore(struct mdesc *mdp, ssize_t size)
       if (mapto == MAP_FAILED) {
         char buff[1024];
         fprintf(stderr,"Internal error: mmap returned MAP_FAILED! error: %s\n",strerror(errno));
-        sprintf(buff,"cat /proc/%d/maps",getpid());
+        snprintf(buff,1024,"cat /proc/%d/maps",getpid());
         int status = system(buff);
         if (status == -1 || !(WIFEXITED(status) && WEXITSTATUS(status) == 0))
           fprintf(stderr, "Something went wrong when trying to %s\n", buff);