René's URL Explorer Experiment


Title: Fix(LDAPObject): Prevent search attrlist memory error by jkoeniger · Pull Request #555 · python-ldap/python-ldap · GitHub

Open Graph Title: Fix(LDAPObject): Prevent search attrlist memory error by jkoeniger · Pull Request #555 · python-ldap/python-ldap

X Title: Fix(LDAPObject): Prevent search attrlist memory error by jkoeniger · Pull Request #555 · python-ldap/python-ldap

Description: Problem Providing a dictionary to attrlist (LDAPObject.search_ext) results in a memory error. See Issue #556 Root cause Function PySequence_Length can return -1 on iterables like dict. The following PyMem_NEW still succeeds due PyMem_NEW(char *, -1 + 1) being equivalent to char** PyMem_Malloc(1), which then can result in a segmentation fault later on. Solution The expected behavior should be either a raised TypeError or that any iterable which contains only strings can be passed. Commit e18c567 enables the latter which is in itself very unlikely to break anything. I would actually prefer to raise a TypeError in the C extension on encountering a dictionary as it is most likely an error on the callers side, maybe we can add that later. The fix in e18c567 is to use seq and PySequence_Fast_GET_SIZE to determine the size of the sequence. This way any iterable which contains only strings can be used. I added two tests in a1bdf47 which will fail without the fix in e18c567.

Open Graph Description: Problem Providing a dictionary to attrlist (LDAPObject.search_ext) results in a memory error. See Issue #556 Root cause Function PySequence_Length can return -1 on iterables like dict. The followin...

X Description: Problem Providing a dictionary to attrlist (LDAPObject.search_ext) results in a memory error. See Issue #556 Root cause Function PySequence_Length can return -1 on iterables like dict. The followin...

Opengraph URL: https://github.com/python-ldap/python-ldap/pull/555

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/checks(.:format)
route-controllerpull_requests
route-actionchecks
fetch-noncev2:9ee586bc-4dcd-cbfd-2149-8391e23c96d9
current-catalog-service-hash87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a
request-idDAFA:49B4D:1130624:15E7823:6975A886
html-safe-noncef4b429c4e1d469e0e23c5daecbca1c375d37aebf2d391f8ee969c215d6a75854
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUZBOjQ5QjREOjExMzA2MjQ6MTVFNzgyMzo2OTc1QTg4NiIsInZpc2l0b3JfaWQiOiI2ODE3ODc4NDA1MDk0NDE4NTY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca4c817161d10cfde53412fc4900daf8d0986ae14432cdf213d055b8cdbf1c4ed
hovercard-subject-tagpull_request:1667695393
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/checks
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-ldap/python-ldap/pull/555/checks
twitter:imagehttps://avatars.githubusercontent.com/u/155648714?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/155648714?s=400&v=4
og:image:altProblem Providing a dictionary to attrlist (LDAPObject.search_ext) results in a memory error. See Issue #556 Root cause Function PySequence_Length can return -1 on iterables like dict. The followin...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-cache
go-importgithub.com/python-ldap/python-ldap git https://github.com/python-ldap/python-ldap.git
octolytics-dimension-user_id33895877
octolytics-dimension-user_loginpython-ldap
octolytics-dimension-repository_id111794776
octolytics-dimension-repository_nwopython-ldap/python-ldap
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id111794776
octolytics-dimension-repository_network_root_nwopython-ldap/python-ldap
turbo-body-classeslogged-out env-production page-responsive full-width full-width-p-0
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-ldap%2Fpython-ldap%2Fpull%2F555%2Fchecks
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-ldap%2Fpython-ldap%2Fpull%2F555%2Fchecks
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fchecks&source=header-repo&source_repo=python-ldap%2Fpython-ldap
Reloadhttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks
Reloadhttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks
Reloadhttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks
python-ldap https://patch-diff.githubusercontent.com/python-ldap
python-ldaphttps://patch-diff.githubusercontent.com/python-ldap/python-ldap
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-ldap%2Fpython-ldap
Fork 137 https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-ldap%2Fpython-ldap
Star 436 https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-ldap%2Fpython-ldap
Code https://patch-diff.githubusercontent.com/python-ldap/python-ldap
Issues 83 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/issues
Pull requests 19 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pulls
Actions https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions
Projects 0 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/projects
Security 3 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/security
Insights https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pulse
Code https://patch-diff.githubusercontent.com/python-ldap/python-ldap
Issues https://patch-diff.githubusercontent.com/python-ldap/python-ldap/issues
Pull requests https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pulls
Actions https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions
Projects https://patch-diff.githubusercontent.com/python-ldap/python-ldap/projects
Security https://patch-diff.githubusercontent.com/python-ldap/python-ldap/security
Insights https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fpython-ldap%2Fpython-ldap%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fpython-ldap%2Fpython-ldap%2Fissues%2Fnew%2Fchoose
jkoenigerhttps://patch-diff.githubusercontent.com/jkoeniger
python-ldap:mainhttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/tree/main
jkoeniger:jkoeniger/fix-ldapsearch-attrlist-memory-errorhttps://patch-diff.githubusercontent.com/jkoeniger/python-ldap/tree/jkoeniger/fix-ldapsearch-attrlist-memory-error
Conversation 10 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555
Commits 2 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/commits
Checks 16 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks
Files changed https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/files
Please reload this pagehttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks
Please reload this pagehttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks
Sign in for the full log viewhttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-ldap%2Fpython-ldap%2Fpull%2F555%2Fchecks
Fix(LDAPObject): Prevent search attrlist memory error https://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks#top
Please reload this pagehttps://patch-diff.githubusercontent.com/python-ldap/python-ldap/pull/555/checks
CI on: pull_request https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156
Ubuntu with Python 3.9 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156/job/55811580148?pr=555
Ubuntu with Python 3.10 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156/job/55811580150?pr=555
Ubuntu with Python 3.11 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156/job/55811580142?pr=555
Ubuntu with Python 3.12 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156/job/55811580187?pr=555
Ubuntu with Python 3.13 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156/job/55811580147?pr=555
Ubuntu with Python pypy3.9 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156/job/55811580146?pr=555
Ubuntu with Python pypy3.10 https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841156/job/55811580144?pr=555
Tox on Fedora on: pull_request https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169
Tox env "py39" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580046?pr=555
Tox env "py310" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580021?pr=555
Tox env "py311" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580098?pr=555
Tox env "py312" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580051?pr=555
Tox env "py313" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580082?pr=555
Tox env "py3-nosasltls" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580045?pr=555
Tox env "py3-trace" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580047?pr=555
Tox env "pypy3" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580035?pr=555
Tox env "doc" on Fedora https://patch-diff.githubusercontent.com/python-ldap/python-ldap/actions/runs/19435841169/job/55811580102?pr=555
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.