From: Peter Lieven Date: Thu, 26 Dec 2013 09:43:15 +0000 (+0100) Subject: nfs_parse_url_incomplete: fix use after free in param parsing X-Git-Tag: upstream/1.9.6^2~154^2~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1f1b1c5c93a4c9fd1d0553b30753866315b0ed5b;p=deb_libnfs.git nfs_parse_url_incomplete: fix use after free in param parsing if no server is specified flagsp points into urls->server. Signed-off-by: Peter Lieven --- diff --git a/lib/libnfs.c b/lib/libnfs.c index b90205d..38da45c 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -277,11 +277,6 @@ flags: } } - if (urls->server && strlen(urls->server) <= 1) { - free(urls->server); - urls->server = NULL; - } - while (flagsp != NULL && *(flagsp+1) != 0) { strp = flagsp + 1; flagsp = strchr(strp, '&'); @@ -297,6 +292,11 @@ flags: } } + if (urls->server && strlen(urls->server) <= 1) { + free(urls->server); + urls->server = NULL; + } + return urls; }