[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ccscript-devel] ccscript3-1.0.9/modules/sort.cpp: some broken code
From: |
David Sugar |
Subject: |
Re: [Ccscript-devel] ccscript3-1.0.9/modules/sort.cpp: some broken code |
Date: |
Fri, 25 Dec 2009 13:23:31 -0500 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Yeah...we should not dereference things off sym until we make sure we
have valid (non-NULL) pointer ;)....
d binderman wrote:
>
> 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/
>
> _______________________________________________
> ccscript-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/ccscript-devel
dyfet.vcf
Description: Vcard