<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>环境变量 on 办公AI智能小助手</title>
    <link>https://blog.qife122.com/tags/%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F/</link>
    <description>Recent content in 环境变量 on 办公AI智能小助手</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <copyright>qife</copyright>
    <lastBuildDate>Tue, 30 Dec 2025 13:39:37 +0800</lastBuildDate>
    <atom:link href="https://blog.qife122.com/tags/%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>cURL代理检测逻辑错误导致长协议方案的环境变量名被截断</title>
      <link>https://blog.qife122.com/p/curl%E4%BB%A3%E7%90%86%E6%A3%80%E6%B5%8B%E9%80%BB%E8%BE%91%E9%94%99%E8%AF%AF%E5%AF%BC%E8%87%B4%E9%95%BF%E5%8D%8F%E8%AE%AE%E6%96%B9%E6%A1%88%E7%9A%84%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%90%8D%E8%A2%AB%E6%88%AA%E6%96%AD/</link>
      <pubDate>Tue, 30 Dec 2025 13:39:37 +0800</pubDate>
      <guid>https://blog.qife122.com/p/curl%E4%BB%A3%E7%90%86%E6%A3%80%E6%B5%8B%E9%80%BB%E8%BE%91%E9%94%99%E8%AF%AF%E5%AF%BC%E8%87%B4%E9%95%BF%E5%8D%8F%E8%AE%AE%E6%96%B9%E6%A1%88%E7%9A%84%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%90%8D%E8%A2%AB%E6%88%AA%E6%96%AD/</guid>
      <description>&lt;h1 id=&#34;报告-3473182---curl中detect_proxy的逻辑错误导致长协议方案的环境变量名被截断&#34;&gt;报告 #3473182 - cURL中&lt;code&gt;detect_proxy&lt;/code&gt;的逻辑错误导致长协议方案的环境变量名被截断&lt;/h1&gt;&#xA;&lt;p&gt;&lt;strong&gt;提交者&lt;/strong&gt;: herdiyanitdev&#xA;&lt;strong&gt;提交时间&lt;/strong&gt;: 10天前&lt;/p&gt;&#xA;&lt;p&gt;在 &lt;code&gt;lib/url.c&lt;/code&gt; 中，&lt;code&gt;detect_proxy&lt;/code&gt; 函数使用了一个固定大小的缓冲区 &lt;code&gt;proxy_env[20]&lt;/code&gt; 来构造代理环境变量名（例如 &lt;code&gt;http_proxy&lt;/code&gt;）。然而，cURL 的 URL 解析器 (&lt;code&gt;lib/urlapi.c&lt;/code&gt;) 允许协议方案名称最长达到 40 个字符 (&lt;code&gt;MAX_SCHEME_LEN&lt;/code&gt;)。当使用长度超过 12 个字符的协议方案时，环境变量名会被 &lt;code&gt;curl_msnprintf&lt;/code&gt; 静默截断为 19 个字符。这导致了一个业务逻辑错误，cURL 可能从一个非预期的（被截断的）环境变量中读取配置，从而导致使用自定义方案的应用程序出现潜在的意外代理行为。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
