mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-24 15:44:32 +00:00
This change fixes a minor flaw in the check for ipc endpoint length. The max_path_size is the max path that an ipc endpoint can have, which is 208. However, that size concerns the null-terminated pathname, so we need to account for an extra null-character too. Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
parent
c02ab17b17
commit
9c5712a79c
1 changed files with 3 additions and 2 deletions
|
|
@ -31,8 +31,9 @@ import (
|
|||
|
||||
// ipcListen will create a Unix socket on the given endpoint.
|
||||
func ipcListen(endpoint string) (net.Listener, error) {
|
||||
if len(endpoint) > int(max_path_size) {
|
||||
log.Warn(fmt.Sprintf("The ipc endpoint is longer than %d characters. ", max_path_size),
|
||||
// account for null-terminator too
|
||||
if len(endpoint)+1 > int(max_path_size) {
|
||||
log.Warn(fmt.Sprintf("The ipc endpoint is longer than %d characters. ", max_path_size-1),
|
||||
"endpoint", endpoint)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue