diff options
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/session.c b/src/session.c index 297f207..485eaf3 100644 --- a/src/session.c +++ b/src/session.c @@ -738,7 +738,7 @@ int *pFd; char tempFile[PATH_MAX]; char *tmp; - sprintf (tempFile, "%s/%sXXXXXX", path, prefix); + snprintf (tempFile, sizeof(tempFile), "%s/%sXXXXXX", path, prefix); tmp = (char *) mktemp (tempFile); if (tmp) { @@ -753,7 +753,7 @@ int *pFd; char tempFile[PATH_MAX]; char *ptr; - sprintf (tempFile, "%s/%sXXXXXX", path, prefix); + snprintf (tempFile, sizeof(tempFile), "%s/%sXXXXXX", path, prefix); ptr = (char *)malloc(strlen(tempFile) + 1); if (ptr != NULL) { @@ -802,7 +802,7 @@ SmPointer clientData; prop1val.value = Argv[0]; prop1val.length = strlen (Argv[0]); - sprintf (userId, "%ld", (long)getuid()); + snprintf (userId, sizeof(userId), "%ld", (long)getuid()); prop2.name = SmUserID; prop2.type = SmARRAY8; prop2.num_vals = 1; @@ -921,7 +921,7 @@ SmPointer clientData; prop1.num_vals = numVals; - sprintf (discardCommand, "rm %s", filename); + snprintf (discardCommand, sizeof(discardCommand), "rm %s", filename); prop2.name = SmDiscardCommand; prop2.type = SmARRAY8; prop2.num_vals = 1; |