mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
In cache_entry_get_property and cache_entry_set_property, use
cache_entry_is_valid to check that the reference to the struct cache_entry is still valid. Thanks to fonseca for the reminder.
This commit is contained in:
parent
8ea7f202b1
commit
2fef4bd531
@ -32,7 +32,7 @@ cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
struct cache_entry *cached = JS_GetPrivate(ctx, obj);
|
||||
|
||||
if (!cached) return JS_FALSE;
|
||||
if (!cache_entry_is_valid(cached)) return JS_FALSE;
|
||||
|
||||
undef_to_jsval(ctx, vp);
|
||||
|
||||
@ -78,7 +78,7 @@ cache_entry_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
struct cache_entry *cached = JS_GetPrivate(ctx, obj);
|
||||
|
||||
if (!cached) return JS_FALSE;
|
||||
if (!cache_entry_is_valid(cached)) return JS_FALSE;
|
||||
|
||||
if (!JSVAL_IS_INT(id))
|
||||
return JS_FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user