diff --git a/docs/changes.txt b/docs/changes.txt index 34b09088f..7cff38539 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -47,6 +47,7 @@ - Fixed clEnqueueNDRangeKernel(): CL_UNKNOWN_ERROR caused by an invalid work-item count during weak-hash-check - Fixed nvapi datatype definition for NvS32 and NvU32 - Fixed WPA/WPA2 cracking in case eapol frame is >= 248 byte +- Fixed string not null terminated inside workaround for checking drm driver path ## ## Technical diff --git a/src/opencl.c b/src/opencl.c index bfc8f0693..a53276b60 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -77,7 +77,11 @@ static int ocl_check_dri (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx) char buf[HCBUFSIZ_TINY]; - if (readlink (drm_card0_driver_path, buf, HCBUFSIZ_TINY) == -1) return 0; + const ssize_t len = readlink (drm_card0_driver_path, buf, HCBUFSIZ_TINY - 1); + + if (len == -1) return 0; + + buf[len] = 0; if (strstr (buf, "amdgpu") == NULL) return 0;