Reject url_keys of invalid size instead of crashing
authorArt Cancro <ajc@citadel.org>
Tue, 12 Feb 2019 23:22:30 +0000 (18:22 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 12 Feb 2019 23:22:30 +0000 (18:22 -0500)
webcit/paramhandling.c

index abe4f328d6e66c7cf3892f0e0ea529bbcf3f548e..1e07fcfb3aa018440580b65670c9061555d5b77c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * parse urlparts and post data
  *
- * Copyright (c) 1996-2013 by the citadel.org team
+ * Copyright (c) 1996-2019 by the citadel.org team
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
@@ -178,6 +178,8 @@ void ParseURLParams(StrBuf *url)
                        syslog(LOG_WARNING, "%s:%d: invalid url_key of size %d in string size %ld",
                                __FILE__, __LINE__, keylen, (long)sizeof(u->url_key)
                        );
+                       free(u);
+                       return;
                }
 
                if (keylen < 0) {