Autor Beitrag
SAiBOT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Di 30.06.09 17:03 
user profile iconBenBE hat folgendes geschrieben Zum zitierten Posting springen:
user profile iconFlamefire hat folgendes geschrieben Zum zitierten Posting springen:
mal ein Frage:
ausblenden Delphi-Quelltext
1:
2:
strcpy(retText,Text);//Strings laden
        strcpy(retKey,rKey);


In einem Treiber strcpy und strcat zu verwenden ist SEHR gewagt ... Bitte lieber strncpy und derivate nutzen. Genauso, wie man den Puffern, die von einem Benutzer kommen, nicht trauen sollte: Wenn ich 33 Non-Zero-Bytes schreibe, erhalte ich bei deiner Variante einen Read-Zugriff hinter dem Puffer-Ende, was im Zweifelsfall und bei schlechtem Alignment zu einem Bluescreen führt. dann lieber strnlen verwenden, was die Längen- und Lesebegrenzung auf den übergebenen Puffer sichert.

Womit wieder einmal bestätigt wäre, dass die meisten C nur bis zum nächsten Buffer Overflow beherrschen ...


Von beherschen kann bei mir garnicht die Rede sein =), macht Sinn was du sagst! Sollte ich mal etwas machen, was Stabil laufen muß, werde ich es mir zu Herzen nehmen, gerade weil derartige Fehler in einem Treiber oftmals das ganze System in den Abgrund reissen!

Wenn ich etwas mehr Zeit habe gibts natürlich noch den versprochenen Blogpost und die Sense fürs Hackerboard . :wink:

_________________
Debuggers don't remove bugs, they only show them in slow-motion.
SAiBOT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Sa 11.07.09 22:54 

_________________
Debuggers don't remove bugs, they only show them in slow-motion.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 11.07.09 23:55 
Dein Blogpost hätte ruhig etwas umfangreicher ausfallen dürfen ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
SAiBOT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: So 12.07.09 11:48 
Ja, meine Zeit ist momentan leider sehr rar, aber jeder der sich für die Materie etwas interessiert weiss was ihr vollbracht habt :D.
Der DF-Link ist ja auch angegeben, wo es etwas mehr ins Detail geht!

_________________
Debuggers don't remove bugs, they only show them in slow-motion.