<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.FoxDiv20200226092504772063 { }body { font-size: 10.5pt; font-family: 微软雅黑; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span></div><div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">Hi, </div><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">Is there anyone who cares this? Isn't the buffer overflow checker able to find it? Or, who can tell me the way to improve it?</div><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">Thanks</div></span></div>
<blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:cfe-dev@lists.llvm.org">jiancai_hao@163.com via cfe-dev</a></div><div><b>Date:</b> 2020-02-22 19:27</div><div><b>To:</b> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev</a></div><div><b>Subject:</b> [cfe-dev] [analyzer]How to find ABV on this case using clang static analyzer</div></div></div><div><div class="FoxDiv20200226092504772063">
<div><span></span>Hi, </div><div><span style="font-family: 'Microsoft YaHei UI', Tahoma; font-size: 13px; line-height: normal; white-space: nowrap; background-color: transparent;">My question is that:</span></div><div>I want to find the buffer overflow on the following case, but clang static analyzer can't report it out, how should I do?</div><div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">=========== the case ============</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">int main(int argc, char **argv)</span></div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>int a[10];</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>for (int i=0; i<=10; i++) {</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>a[i]=0;                        <---- array bound over run here</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div>}</div></div><div>=========== the case =============</div><div>Thanks.</div><div><br></div>
</div></div></blockquote>
</body></html>