Re: Get ASCII value for character when higher than 127

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Fri, 25 May 2007 10:45:56 -0500, David Wilkinson
<no-reply@xxxxxxxxxxxx> wrote:


char path[80];
strcpy (path,"C:\\pwds\\");
strcat (path,timeString);
strcat (path,".txt");


char xmlmsg[200];
strcpy (xmlmsg,"<userpwd><username>");
strcat (xmlmsg,usernameStr);
strcat (xmlmsg,"</username><password>");
strcat (xmlmsg,passwordStr);
strcat (xmlmsg,"</password></userpwd>");

Sandra:

A few things I notice:

To add to David's notes, I would deprecate the use of char buffer and
strcpy and strcat... better using std::ostringstream and operator <<
or at least the safe versions of str... functions (when you specify
the buffer size to avoid buffer overruns).

MrAsm
.



Relevant Pages

  • [Full-Disclosure] Exploit for Kerio MailServer 5.6.3
    ... it is possible to use 'RCPT TO' to enumerate */ ... Recode the shellcode to add normal user! ... strcpy (buffer, req); ... strcat; ...
    (Full-Disclosure)
  • Re: multiple or
    ... : depth-ors depth ors; ... opcode ret inc-rp rp2address sp2address cmd_q2pc ... create buffer 256 allot ... r> if s" or" strcat then ...
    (comp.lang.forth)
  • Re: multiple or
    ... because I think the computer should help programming and ... create buffer 256 allot ... dup>r bp swap cmove ... r> if s" or" strcat then ...
    (comp.lang.forth)
  • Re: substring finding problem!
    ... weaknesses (no protection from buffer overun in strcpy, ... strcat, const inconsistencies with strchr, very poor functionality ... an overly difficult interface and buffer ...
    (comp.lang.c)
  • Re: why strcat doesnot work for user defined cases
    ... if we execute the program having these particular statements,the strcat ... Note that in general you should probably avoid strcatand strcpy(). ... I know that they can be used safely, but that requires that you know the size of the source buffer and the space left in the destination buffer; if you have that information you can replace them both with memcpywhich is usually faster. ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)