BES1-941: Increase Process name buffer length from 16 to 64#306
BES1-941: Increase Process name buffer length from 16 to 64#306yogeswaransky wants to merge 1 commit intosupport/1.8.5from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the DCA utility header to allow longer process names by increasing the fixed buffer size used in procMemCpuInfo, which is used by process/memory/CPU collection helpers.
Changes:
- Increased
BUF_LENmacro from 16 to 64 indcautil.h.
| T2ERROR getGrepResults(GrepSeekProfile **GSP, Vector *markerList, bool isClearSeekMap, bool check_rotated, char *customLogPath); | ||
| #define PREFIX_SIZE 5 | ||
| #define BUF_LEN 16 | ||
| #define BUF_LEN 64 |
There was a problem hiding this comment.
Increasing BUF_LEN increases the size of fixed arrays (e.g., procMemCpuInfo.processName), but current call sites copy into these arrays using length derived from the input string (e.g., memcpy(..., strlen(processName)+1) in dcaproc.c) without bounding to BUF_LEN. This remains a potential buffer overflow if a caller passes a name longer than BUF_LEN-1. Consider switching to a bounded copy (and optionally returning an error or explicitly truncating) everywhere these buffers are written.
| T2ERROR getGrepResults(GrepSeekProfile **GSP, Vector *markerList, bool isClearSeekMap, bool check_rotated, char *customLogPath); | ||
| #define PREFIX_SIZE 5 | ||
| #define BUF_LEN 16 | ||
| #define BUF_LEN 64 |
There was a problem hiding this comment.
BUF_LEN is used not only for processName but also for cpuUse and memUse in procMemCpuInfo, so this change increases those buffers as well. If the intent is strictly to increase the process name limit, consider introducing a dedicated PROCESS_NAME_LEN (leaving cpuUse/memUse unchanged) or update the PR title/description to reflect the broader impact.
| T2ERROR getGrepResults(GrepSeekProfile **GSP, Vector *markerList, bool isClearSeekMap, bool check_rotated, char *customLogPath); | ||
| #define PREFIX_SIZE 5 | ||
| #define BUF_LEN 16 | ||
| #define BUF_LEN 64 |
There was a problem hiding this comment.
There are existing unit tests covering getProcInfo/getProcUsage, but none appear to validate behavior with process names longer than the previous 16-byte limit. Since this change is explicitly increasing the supported name length, add a test that exercises a >16 and <=63 character processName to ensure it’s handled safely (no overflow/truncation surprises).
No description provided.