mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
smjs_load_uri: check for empty URI
In smjs_load_uri, check whether the the given URI string is empty. If it is, return JS_FALSE right away rather than continuing on and passing get_uri an empty string, which triggers an assertion failure later on.
This commit is contained in:
parent
f8bdc3ca9e
commit
e310843a2a
@ -79,6 +79,7 @@ smjs_load_uri(JSContext *ctx, uintN argc, jsval *rval)
|
||||
|
||||
jsstr = JS_ValueToString(smjs_ctx, argv[0]);
|
||||
uri_string = JS_EncodeString(smjs_ctx, jsstr);
|
||||
if (!uri_string || !*uri_string) return JS_FALSE;
|
||||
|
||||
uri = get_uri(uri_string, 0);
|
||||
if (!uri) return JS_FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user