Foundationপ্রথম নীতি থেকে
LEVEL 10 · Computer Security

Buffer Overflow

বাফার ওভারফ্লো

Fixed-size buffer-এ bounds-check ছাড়া বেশি data লিখলে adjacent memory (সহ saved return address) ওভাররাইট হয়।

also: buffer-overrun

char buf[8];
strcpy(buf, attacker_input);   // input > 8 byte হলে buf-এর পরের memory-ও লেখা হয়
  • C/C++-এ bounds checking automatic না — programmer-এর দায়িত্ব, ভুল হলে compiler/runtime কেউ থামায় না
  • Stack-এ overflow হলে saved frame pointer আর return address-ও ওভাররাইট হতে পারে — execution attacker-নির্ধারিত address-এ jump করতে পারে
  • Rust-এর মতো memory-safe language-এ bounds check compile/runtime-এ বাধ্যতামূলক — এই bug class structurally অসম্ভব হয়ে যায়