Samples updates#1458
Merged
Merged
Conversation
jshcodes
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sample Bug Fixes
alerts_triage.py
pyqtSignal(int, bool)emitting a string.meta.get("offset", "")crashes at runtime0closeEvent. Segfault if user closes during a fetchcloseEventthat cancels and waits on workers"last_"in a hostname falsely suppressed the default time windowfieldname:pattern insteadQt.CheckState.Checked.valuecomparison is fragile across Qt versionsQt.CheckState(state) == Qt.CheckState.Checkeddevice_control_policy_manager.py
closeEvent. Workers never stopped on closecloseEventthat waits on_active_workersperformDeviceControlPoliciesActionraw operation ID used alongside Pythonic namesperform_action(live-verified)auth_object=sdk(live-verified)_on_acceptExceptionDialoghad 9@propertymethods, each a one-liner on a throwaway dialogfilevantage_monitor.py
print()statements fired on every auto-refreshfile_pathbut real API usesentity_path. Demo exercised the wrong code pathentity_pathFetchChangesWorker.run(). New OAuth2 token every 30sFileVantageWindow.__init__, passed to workersimport timeinsideSuppressWorker.run()closeEventcalledworker.wait()with no timeout. App could hang up to 30s on closeworker.wait(5000)high_activity_hosts.py
Lockimported but never usedos._exit()at end of main bypasses Python shutdownsys.exit()datetime.utcnow()deprecated since Python 3.12. Live DeprecationWarning confirmed (5 call sites)datetime.now(timezone.utc)max_workersparameter incount_alerts_by_hostdocumented as unused< 1 hourrecency tier present in real scoring<1h,<24h,<72h)ods_manager.py
_loadingflag written from background thread without lock. Race with 15s poll timerself._lockwx.MessageDialogcreated inline with.ShowModal()but never.Destroy(). Native window handle leakDestroy()called afterShowModal()auth_object=sdk(live-verified)rtr_replay.py
format_durationannotated asfloatbut checks forNoneOptional[float]consume_argumentsreturn type annotated asobject-> Namespace--demoflaglimitcast tostrincall_audit_sessions. FalconPy accepts intstr()cast"=" * 70in one function,"-" * 68in anotherrtr_replay_gui.py
closeEventcalledworker.terminate(). Same file documents this corrupts Python's GIL in urllib3/SSLterminate()call; OS reclaims thread on exitPrefetchWorkercreated a new SDK instance on every loop iteration. New OAuth2 token per pageSessionFilterProxywas an empty subclass ofQSortFilterProxyModelwith no methodsQSortFilterProxyModeldirectly_ClickableLabel,_show_easter_egg,_PUNK_SPIDER_PATH) in a production sampleconsume_argumentsreturn type annotated asobject-> Namespacespotlight_vuln_dashboard.py
_build_fqlfunction defined but never called_filtered_records. Opens wrong CVE after sortingQt.UserRoleat insert time; handler reads from there"us1"producedhttps://api.us1.crowdstrike.com_after_tokenassigned then immediately suppressed with# noqa: F841auth_object=sdk(live-verified)tailored_intel_browser.py
_scrub_credentials_from_argvmutatedsys.argvthenKIVY_NO_ARGS="1"was set immediately after, making the mutation pointlessKIVY_NO_ARGSset before Kivy imports, standardargparseused inmain()json.loadscalldatetime.utcfromtimestampdeprecated since Python 3.12. Live DeprecationWarning confirmeddatetime.fromtimestamp(ts, tz=timezone.utc)import reandimport syswith no usageEventRecord._rawstored a reference to the raw dict. Caller mutation changed stored datadict(raw)copyTabButtonPython class had no methods or propertieszta_score_viewer.py
fetch_bucket_countsmade 11 separate API calls;_build_bucketsdid the same client-side for freefetch_bucket_counts; call sites now use_build_buckets_api_after_tokenand_has_more_api_datawritten from background thread without lockwith self.state.lockfloat(None)crash when API returnsoverall: null. Confirmed live withTypeErrorfloat(assessment.get("overall") or raw.get("score") or 0)fetch_auditreturned identical value for both success and failure. Caller could not distinguishtuple[bool, dict]; success returns(True, body)auth_object=sdk(live-verified)_refresh_pendingaccessed as protected member outsideAppStaterefresh_pending(public)