From 3591f2d2567b82195df21f1970fe06f16e8eebba Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Fri, 27 Mar 2015 21:47:27 +0000 Subject: [PATCH] [462781] Allow longer paths on Windows. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=462781 --- ChangeLog.txt | 4 ++++ lib/util_mosq.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9bcf54f7..95fe6e7d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,6 @@ +1.4.1 - 2015xxxx +================ + Broker: - Fix possible crash under heavy network load. Closes #463241. - Fix possible crash when using pattern ACLs. @@ -12,6 +15,7 @@ Client library: - Return -1 on error from mosquitto_socket(). Closes #461705. - Fix crash on multiple calls to mosquitto_lib_init/mosquitto_lib_cleanup. Closes #462780. +- Allow longer paths on Windows. Closes #462781. 1.4 - 20150218 diff --git a/lib/util_mosq.c b/lib/util_mosq.c index 16105635..2909a219 100644 --- a/lib/util_mosq.c +++ b/lib/util_mosq.c @@ -307,10 +307,10 @@ int _mosquitto_hex2bin(const char *hex, unsigned char *bin, int bin_max_len) FILE *_mosquitto_fopen(const char *path, const char *mode) { #ifdef WIN32 - char buf[MAX_PATH]; + char buf[4096]; int rc; - rc = ExpandEnvironmentStrings(path, buf, MAX_PATH); - if(rc == 0 || rc == MAX_PATH){ + rc = ExpandEnvironmentStrings(path, buf, 4096); + if(rc == 0 || rc > 4096){ return NULL; }else{ return fopen(buf, mode);