Re: Using c runtime funcs on a BSTR
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Thu, 26 Jan 2006 17:15:09 -0800
The buffer is 10 characters. Pass any larger string and you
get buffer overrun. I suggest at the very least you should use
snprintf() instead...
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
<sbrade@xxxxxxxxx> wrote in message
news:1138233352.111135.29480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Thanks for both your replies.
>
> I have just inherited this code base and am going over the layout of
> the classes and trying to understand their inner workings & am
> stumbling across various patterns that I'm concerned about, and am
> looking for feedback on improvements or issues with code that's just
> plain wrong and that needs fixing. I have found out that there are
> various memory leaks that have been detected in the field and hence the
> concern.
>
> So, besides the check for an NULL Input string, is your recommendation
> that the call to sprintf may not cause any issues & be left as-is?
>
> Thanks,
> Braden.
>
.
- References:
- Using c runtime funcs on a BSTR
- From: sbrade
- Re: Using c runtime funcs on a BSTR
- From: Alexander Nickolov
- Re: Using c runtime funcs on a BSTR
- From: sbrade
- Using c runtime funcs on a BSTR
- Prev by Date: Re: Has this been the solution?
- Next by Date: Getting LIBID or DIID from #import -or- improper creation of sink event handler
- Previous by thread: Re: Using c runtime funcs on a BSTR
- Next by thread: Re: Using c runtime funcs on a BSTR
- Index(es):
Relevant Pages
|