[Pkg-tcltk-devel] tclodbc off-by-one error

Sergei Golovan sgolovan at gmail.com
Wed Oct 4 19:53:05 BST 2023


Hi Massimo, Christian,

Please, disregard my previous email. I thought that the package in
question is tdbc-odbc. In tclodbc indeed SQLDescribeParam is called
with an incorrect parameter index.

So it's better to report this bug to the tclodbc package.

On Wed, Oct 4, 2023 at 2:40 PM Sergei Golovan <sgolovan at gmail.com> wrote:
>
> Hi, Massimo, Christian,
>
> As far as I can see in the code, the parameter index is calculated as
> i+1 from the loop variable i:
>
> for (i = 0; i < nParams; ++i) {
>     rc = SQLDescribeParam(sdata->hStmt, i+1,
> ...
>
> Can you be more specific in which query fails and how?
>
> On Wed, Oct 4, 2023 at 2:31 PM Massimo Manghi
> <massimo.manghi at rivetweb.org> wrote:
> >
> > Thank you Christian, would you please report a bug against package tclodbc?
> >
> >   -- Massimo
> >
> > On 04/10/23 06:35, Christian Werner wrote:
> > > Hello maintainers of the tclodbc Debian package,
> > >
> > > there's a severe bug in the SQLDescribeParam() call.
> > > While that API requires the parameter index to start counting
> > > from 1, the loop in tclodbc running over the query
> > > parameters starts with 0. This can cause queries to fail due
> > > to data type mismatches.
> > >
> > > BR,
> > > Christian
> > >
> > > _______________________________________________
> > > Pkg-tcltk-devel mailing list
> > > Pkg-tcltk-devel at alioth-lists.debian.net
> > > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-tcltk-devel
> >
> > _______________________________________________
> > Pkg-tcltk-devel mailing list
> > Pkg-tcltk-devel at alioth-lists.debian.net
> > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-tcltk-devel
>
>
>
> --
> Sergei Golovan



-- 
Sergei Golovan



More information about the Pkg-tcltk-devel mailing list