]> git.neil.brown.name Git - edlib.git/commitdiff
Avoid null pointer deref when ccache used.
authorNeilBrown <neil@brown.name>
Thu, 27 Jul 2023 11:32:07 +0000 (21:32 +1000)
committerNeilBrown <neil@brown.name>
Thu, 27 Jul 2023 11:32:57 +0000 (21:32 +1000)
This can make ->home NULL which times_up() no trips over.

I should probably discard this ccache stuff.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
core-pane.h

index 37a2b51c3e0abac76a390a05293fc71b2bab4662..ddb8283860781e6426c58957644196e53f8ebccb 100644 (file)
@@ -91,6 +91,7 @@ Requirements for a v1.0 release
 Core features
 -------------
 
+- [ ] Discard ccache ??
 - [ ] Ensure all panes that should use "Free" properly, and find some
       what to encourage its use.
 - [ ] Add optional unit-test interface for modules.  This should be
index 1e1460472adf47e4a358c79549c46601a6be2a8c..24ce3ec6f0e3d42d25b1e83fd06b8fd3d9dd4455 100644 (file)
@@ -121,8 +121,10 @@ static inline int do_call_val(enum target_type type, struct pane *home,
                /* fall-through */
        case TYPE_focus:
                if (ccache) {
-                       ci.home = ccache->home;
-                       ci.comm = ccache->comm;
+                       if ((void*)ccache->home)
+                               ci.home = ccache->home;
+                       if ((void*)ccache->comm)
+                               ci.comm = ccache->comm;
                }
                ret = key_handle(&ci);
                break;