{"id":24,"date":"2022-11-25T17:22:17","date_gmt":"2022-11-25T17:22:17","guid":{"rendered":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/comptia-cysacs0-002-question018\/"},"modified":"2022-11-25T17:22:17","modified_gmt":"2022-11-25T17:22:17","slug":"comptia-cysacs0-002-question018","status":"publish","type":"post","link":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/comptia-cysacs0-002-question018\/","title":{"rendered":"CompTIA CySA+CS0-002 &#8211; Question018"},"content":{"rendered":"<div class=\"question\">An internally developed file-monitoring system identified the following excerpt as causing a program to crash often:<br \/>\nchar filedata[100];<br \/>\nfp = fopen(&quot;access.log&quot;, &quot;r&quot;);<br \/>\nsrtcopy (filedata, fp);<br \/>\nprintf (&quot;%sn&quot;, filedata);<br \/>\nWhich of the following should a security analyst recommend to fix the issue?<br \/><strong><br \/>A.<\/strong> Open the access.log file in read\/write mode.<br \/><strong>B.<\/strong> Replace the strcpy function.<br \/><strong>C.<\/strong> Perform input sanitization.<br \/><strong>D.<\/strong> Increase the size of the file data butter.<\/div>\n<p><\/p>\n<style> .hidden-div{ display:none } <\/style>\n<p>\t\t\t\t\t\t\t<button onclick=\"getElementById('hidden-div').style.display = 'block'\"> Show Answer <\/button> <button onclick=\"getElementById('hidden-div').style.display = 'none'\">Hide Answer<\/button><\/p>\n<div class=\"hidden-div\" id=\"hidden-div\"><span style=\"\"><\/p>\n<div class=\"answer\">Correct Answer: <strong>B<\/strong><\/div>\n<p><\/strong><\/span> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>An internally developed file-monitoring system identified the following excerpt as causing a program to crash often: char filedata[100]; fp = fopen(&quot;access.log&quot;, &quot;r&quot;); srtcopy (filedata, fp); printf (&quot;%sn&quot;, filedata); Which of the following should a security analyst recommend to fix the issue?A. Open the access.log file in read\/write mode.B. Replace the strcpy function.C. Perform input sanitization.D. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[3,21],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-comptia-cysacs0-002","tag-comptia-cysacs0-002","tag-question-018"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":0,"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"wp:attachment":[{"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exampracticetests.com\/c\/CySA+CS0-002\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}