[{"data":1,"prerenderedAt":139},["ShallowReactive",2],{"term-b\u002Fbuffer-overflow":3,"related-b\u002Fbuffer-overflow":127},{"id":4,"title":5,"acronym":6,"body":7,"category":108,"description":109,"difficulty":110,"extension":111,"letter":112,"meta":113,"navigation":77,"path":114,"related":115,"seo":121,"sitemap":122,"stem":125,"subcategory":6,"__hash__":126},"terms\u002Fterms\u002Fb\u002Fbuffer-overflow.md","Buffer Overflow",null,{"type":8,"value":9,"toc":102},"minimark",[10,15,19,23,26,30,91,95,98],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"A buffer overflow is like trying to pour 10 gallons of water into a 1-gallon jug — it spills everywhere and can destroy things nearby. In code, if you write more data than a memory slot can hold, it overwrites neighboring memory. This is a classic security vulnerability in C programs.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"A buffer overflow occurs when a program writes data beyond the allocated bounds of a fixed-size buffer in memory, corrupting adjacent memory regions. It can cause crashes, undefined behavior, or be exploited by attackers to overwrite return addresses and execute arbitrary code. This is a primary attack vector in C\u002FC++ programs without bounds checking.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-c shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F C example (DANGEROUS — don't do this):\nchar buffer[8];\nstrcpy(buffer, \"This string is way too long!\");\n\u002F\u002F Overwrites memory BEYOND the 8-byte buffer\n\u002F\u002F Can corrupt data, crash, or allow code execution\n\n\u002F\u002F Safe alternative:\nstrncpy(buffer, input, sizeof(buffer) - 1);\n","c","",[38,39,40,48,54,60,66,72,79,85],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"\u002F\u002F C example (DANGEROUS — don't do this):\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"char buffer[8];\n",[41,55,57],{"class":43,"line":56},3,[41,58,59],{},"strcpy(buffer, \"This string is way too long!\");\n",[41,61,63],{"class":43,"line":62},4,[41,64,65],{},"\u002F\u002F Overwrites memory BEYOND the 8-byte buffer\n",[41,67,69],{"class":43,"line":68},5,[41,70,71],{},"\u002F\u002F Can corrupt data, crash, or allow code execution\n",[41,73,75],{"class":43,"line":74},6,[41,76,78],{"emptyLinePlaceholder":77},true,"\n",[41,80,82],{"class":43,"line":81},7,[41,83,84],{},"\u002F\u002F Safe alternative:\n",[41,86,88],{"class":43,"line":87},8,[41,89,90],{},"strncpy(buffer, input, sizeof(buffer) - 1);\n",[11,92,94],{"id":93},"when-youll-hear-this","When You'll Hear This",[16,96,97],{},"\"The vulnerability was a buffer overflow in the input parser.\" \u002F \"Managed languages like Python prevent buffer overflows automatically.\"",[99,100,101],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":50,"depth":50,"links":103},[104,105,106,107],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":93,"depth":50,"text":94},"general","A buffer overflow is like trying to pour 10 gallons of water into a 1-gallon jug — it spills everywhere and can destroy things nearby.","advanced","md","b",{},"\u002Fterms\u002Fb\u002Fbuffer-overflow",[116,117,118,119,120],"Memory Leak","Security","Bug","Runtime Error","C",{"title":5,"description":109},{"changefreq":123,"priority":124},"weekly",0.7,"terms\u002Fb\u002Fbuffer-overflow","N9bQt-HeBrYTNVE28fvPl2EErQPXdd8PH5ZehQu1a-8",[128,132,136],{"title":118,"path":129,"acronym":6,"category":108,"difficulty":130,"description":131},"\u002Fterms\u002Fb\u002Fbug","beginner","A bug is anything in your code that makes it behave wrong.",{"title":116,"path":133,"acronym":6,"category":108,"difficulty":134,"description":135},"\u002Fterms\u002Fm\u002Fmemory-leak","intermediate","A memory leak is when your program keeps grabbing more memory but never gives it back, like filling a bathtub without a drain.",{"title":119,"path":137,"acronym":6,"category":108,"difficulty":130,"description":138},"\u002Fterms\u002Fr\u002Fruntime-error","A runtime error is one that only shows up when your program is actually running, not before.",1776518261510]