gorump icon indicating copy to clipboard operation
gorump copied to clipboard

no bounds checks in find null in string1.go

Open yuval-k opened this issue 9 years ago • 3 comments

I had a crash on due bounds not being checked in string1.go

to fix it i had to change the loop in findnull()

from this:

    for p[l] != 0 {
            l++
    }

to this:

    for l < len(p) && p[l] != 0 {
            l++
    }
    if l == len(p) {
      return 0
    }

yuval-k avatar Mar 06 '16 10:03 yuval-k

@uvgroovy what's this running under? kvm/xen ? what memory amount were you using? we prob. need a little bit more information for this one... I think there's two important pieces we are missing currently on this project...

  1. test suite running inside the vm - we really should get this going sooner rather than later

  2. the ability to have our changes isolated from the source -- a portion of this can be achieved by using build tags - however in this example I feel that it would benefit from a test, I think it would be worth comparing what MaxMem is set to here and seeing what you had allocated for it - that's def. something that is still needing extra support - https://github.com/deferpanic/gorump/issues/14 - I have a strong suspicion that you are running into this problem

eyberg avatar Mar 07 '16 16:03 eyberg

I was using VMware Fusion; mem amount was 256MB

@eyberg let me know if you want me to run anything inside the VM

yuval-k avatar Mar 07 '16 18:03 yuval-k

I suppose if you want to make a pull just throw this into a new file and use the rumprun build tag for now, we'll want to eventually start running the tests inside as part of the ci build process

eyberg avatar Mar 08 '16 16:03 eyberg