increase peb cmdline buffer size
This commit is contained in:
parent
df5e418f30
commit
b8a09c70f0
|
@ -84,7 +84,7 @@ int sigar_proc_cmdline_get(sigar_t *sigar, HANDLE proc, char *cmdline)
|
|||
int status;
|
||||
LPBYTE scratch;
|
||||
DWORD base;
|
||||
WCHAR buf[MAX_PATH];
|
||||
WCHAR buf[SIGAR_CMDLINE_MAX];
|
||||
|
||||
if ((status = sigar_peb_get(sigar, proc, &base)) != SIGAR_OK) {
|
||||
return status;
|
||||
|
@ -96,10 +96,10 @@ int sigar_proc_cmdline_get(sigar_t *sigar, HANDLE proc, char *cmdline)
|
|||
|
||||
PEB_NEXT(scratch); //skip exe name
|
||||
|
||||
wcsncpy(buf, (LPWSTR)scratch, MAX_PATH);
|
||||
buf[MAX_PATH-1] = L'\0';
|
||||
wcsncpy(buf, (LPWSTR)scratch, SIGAR_CMDLINE_MAX);
|
||||
buf[SIGAR_CMDLINE_MAX-1] = L'\0';
|
||||
|
||||
SIGAR_W2A(buf, cmdline, MAX_PATH);
|
||||
SIGAR_W2A(buf, cmdline, SIGAR_CMDLINE_MAX);
|
||||
|
||||
return SIGAR_OK;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
/* see apr/include/arch/win32/atime.h */
|
||||
#define EPOCH_DELTA INT64_C(11644473600000000)
|
||||
|
||||
#define SIGAR_CMDLINE_MAX (MAX_PATH * 3)
|
||||
|
||||
static __inline sigar_uint64_t FileTimeToTime(FILETIME *ft)
|
||||
{
|
||||
sigar_uint64_t time;
|
||||
|
|
|
@ -919,7 +919,7 @@ static int sigar_remote_proc_args_get(sigar_t *sigar, sigar_pid_t pid,
|
|||
sigar_proc_args_t *procargs)
|
||||
{
|
||||
int status;
|
||||
char cmdline[MAX_PATH], *ptr = cmdline, *arg;
|
||||
char cmdline[SIGAR_CMDLINE_MAX], *ptr = cmdline, *arg;
|
||||
HANDLE proc = open_process(pid);
|
||||
|
||||
if (!proc) {
|
||||
|
|
Loading…
Reference in New Issue