ccscript-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccscript-devel] ccscript3-1.0.9/modules/sort.cpp: some broken code


From: d binderman
Subject: [Ccscript-devel] ccscript3-1.0.9/modules/sort.cpp: some broken code
Date: Thu, 24 Dec 2009 10:29:51 +0000


Hello there,

I just had a look at the source code of ccscript3-1.0.9/modules/sort.cpp,
around line 140

        Symbol *sym = mapSymbol(getOption(NULL));
        size_t count = 0;
        Array *a = (Array *)&sym->data;
        char *base = sym->data + sizeof(Array);
        size_t size = a->rec + 1;

        if(!sym)
        {
                error("sort-missing-symbol");
                return true;
        }

In assigning to base, sym is assumed to be non-NULL. Suggest new code

        Symbol *sym = mapSymbol(getOption(NULL));

        if(!sym)
        {
                error("sort-missing-symbol");
                return true;
        }
        size_t count = 0;
        Array *a = (Array *)&sym->data;
        char *base = sym->data + sizeof(Array);
        size_t size = a->rec + 1;

Regards

David Binderman

                                          
_________________________________________________________________
Got more than one Hotmail account? Save time by linking them together
 http://clk.atdmt.com/UKM/go/186394591/direct/01/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]