Date: Fri, 11 Jul 2008 22:00:40 GMT From: Dmitry Andrianov <666.root@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/125523: [libc] strcpy(3) buffer overflow Message-ID: <200807112200.m6BM0eiA098529@www.freebsd.org> Resent-Message-ID: <200807112210.m6BMA1xT095028@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 125523 >Category: misc >Synopsis: [libc] strcpy(3) buffer overflow >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 11 22:10:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Dmitry Andrianov >Release: 7.0 >Organization: 79.120.123.5 >Environment: FreeBSD zingel.dubki.ru 7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 #4: Thu Jul 10 07:17:09 EEST 2008 beastie@zingel.dubki.ru:/usr/obj/usr/src/sys/BEASTIE i386 >Description: Hello. I found out an error, at the use of the following code: -- #include <stdio.h> #include <stdlib.h> #include <unistd.h> int foobar(int x, char *str) { char buf[256]; strcpy(buf, str); return x; } int main(int argc, char **argv) { foobar(64, argv[1]); return 1; } -- error message: [root@zingel ~/test]# gcc -o strcpy strcpy.c [root@zingel ~/test]# ./strcpy Segmentation fault: 11 (core dumped) [root@zingel ~/test]# gdb -tui strcpy .. (gdb) r Starting program: /root/test/strcpy (no debugging symbols found)...(no debugging symbols found)... Program received signal SIGSEGV, Segmentation fault. 0x2814533a in strcpy () from /lib/libc.so.7 -- Check, please. Thank You. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807112200.m6BM0eiA098529>