Patch from upstream, slightly modified because cad/opencascade has been fixed against the reported crash. PR: 277312 Approved by: yuri (maintainer)