Skip to content

Commit

Permalink
Merge 5f77fe4 into a0de8e9
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Reichel committed Sep 3, 2019
2 parents a0de8e9 + 5f77fe4 commit 65c969d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/ununpack/agent/traverse.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ void TraverseChild (int Index, ContainerInfo *CI, char *NewDir)
if (CI->TopContainer && UseRepository)
{
RemovePostfix(UploadFileName);
strncpy(CI->PartnameNew, UploadFileName, sizeof(CI->PartnameNew) - 1);
memcpy(CI->PartnameNew, UploadFileName, sizeof(CI->PartnameNew));
CI->PartnameNew[sizeof(CI->PartnameNew)-1] = 0;
}
else
/**
Expand Down
2 changes: 1 addition & 1 deletion src/ununpack/agent/ununpack-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ permlist * SetDiskPerm (char *inode, permlist *List,
int ExtractDisk (char *Source, char *FStype, char *Destination)
{
int rc;
char Cmd[FILENAME_MAX*4]; /* command to run */
char Cmd[FILENAME_MAX*7]; /* command to run */
char Line[FILENAME_MAX*2];
char *s;
FILE *Fin;
Expand Down
2 changes: 1 addition & 1 deletion src/ununpack/agent/ununpack-iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ mode_t GetISOMode (char *Line)
**/
int ExtractISO (char *Source, char *Destination)
{
char Cmd[FILENAME_MAX*4]; /* command to run */
char Cmd[FILENAME_MAX*5]; /* command to run */
char Line[FILENAME_MAX];
int Len;
char *s; /* generic string pointer */
Expand Down
6 changes: 3 additions & 3 deletions src/ununpack/agent/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ int IsInflatedFile(char *FileName, int InflateSize)
{
int result = 0;
char FileNameParent[PATH_MAX];
memset(FileNameParent, 0, PATH_MAX);
struct stat st, stParent;
strncpy(FileNameParent, FileName, sizeof(FileNameParent));
memcpy(FileNameParent, FileName, sizeof(FileNameParent));
FileNameParent[PATH_MAX-1] = 0;
char *lastSlashPos = strrchr(FileNameParent, '/');
if (NULL != lastSlashPos)
{
Expand Down Expand Up @@ -631,7 +631,7 @@ void CheckCommands (int Show)
int RunCommand (char *Cmd, char *CmdPre, char *File, char *CmdPost,
char *Out, char *Where)
{
char Cmd1[FILENAME_MAX * 3];
char Cmd1[FILENAME_MAX * 5];
char CWD[FILENAME_MAX];
int rc;
char TempPre[FILENAME_MAX];
Expand Down

0 comments on commit 65c969d

Please sign in to comment.