>_0xFORUM
Sign in

Bounds-checked slice helpers I copy into every C tool

in Coding15 replies2k views

Three functions: need(n), take(n), remain(). Every parser bug I still write is because I did not use them.

Paste yours. I will paste mine. We will argue about names.

static int need(buf *b, size_t n) { return b->n - b->i >= n; }

Refs: CVE Program

Lab / educational. Public binaries and patched classes only. Isolated VM.

// 15 REPLIES

@buffr

I want the listing, not the decompiler story. You wrote «Three functions: need(n), take(n), remain()». That is the sentence I keep. Dry-run

The graph hid it. The listing did not. Trust the listing. Good. Dated shot, version in the post. «Bounds-checked slice helpers I copy into every C tool» — specifically Three functions: need(n), take(n), remain(). Checksums are not hashes. Stop keying maps with CRC32. Which build of the tool? I got burned mixing notes across versions. I reproduced it on lab build 1074.

Bookmarking this for the lab wiki. You wrote «Three functions: need(n), take(n), remain()». That is the sentence I keep. Need/take/remain. Every C parser I still write uses them. Which build of the tool? I got burned mixing notes across versions. Version in my shot: current lab snapshot, not last year's blog.

@dump_the_core

Bookmarking this for the lab wiki. You wrote «Three functions: need(n), take(n), remain()». That is the sentence I keep. Need/take/remain. E

That insult was not a technical point. I am reporting it. I failed this exact class in January. The load-bearing line: Three functions: need(n), take(n), remain(). Implement encodings from the spec and a test vector, not from a blog post. My note id for this: 78-09.

@axi0m

The screenshot is the useful part of the post. The load-bearing line: Three functions: need(n), take(n), remain(). If you intern, intern cop

I am reporting the sample-drop hint. Hash and corpus tag only. This is the writeup I wanted when I was stuck. On «Bounds-checked slice helpers I copy into every C tool»: Three functions: need(n), take(n), remain(). Do not mmap untrusted files. I will die on this. Version in my shot: current lab snapshot, not last year's blog.

@analyst

I failed this exact class in January. The load-bearing line: Three functions: need(n), take(n), remain(). Implement encodings from the spec

The screenshot is the useful part of the post. The load-bearing line: Three functions: need(n), take(n), remain(). If you intern, intern copies. Views into a temp will haunt you. Pinned a comment at 0x140006c97 in the listing.

I want the listing, not the decompiler story. You wrote «Three functions: need(n), take(n), remain()». That is the sentence I keep. Dry-run default on destructive flags. Lab tools delete files. I reproduced it on lab build 1336.

Also: Fuzz your own parser. If CI has no fuzzer, the intern is the fuzzer.

Please keep the hashes and drop the mystery zips. On «Bounds-checked slice helpers I copy into every C tool»: Three functions: need(n), take(n), remain(). Do not mmap untrusted files. I will die on this. My note id for this: 78-14.

I will argue the opposite and then probably agree. On «Bounds-checked slice helpers I copy into every C tool»: Three functions: need(n), take(n), remain(). Dry-run default on destructive flags. Lab tools delete files. I still have the snapshot named codi-120-pre.

@rfsec

I will argue the opposite and then probably agree. On «Bounds-checked slice helpers I copy into every C tool»: Three functions: need(n), tak

If you cannot paste bytes, you do not have a counterexample. Agreed on the class, not on the tool. «Bounds-checked slice helpers I copy into every C tool» — specifically Three functions: need(n), take(n), remain(). Need/take/remain. Every C parser I still write uses them. I will +rep a listing and −rep a vibe. That is the deal.

Please keep the hashes and drop the mystery zips. The load-bearing line: Three functions: need(n), take(n), remain(). Need/take/remain. Every C parser I still write uses them. If anyone DMs me a zip I will not open it. Hash in-thread.

@sigx

Please keep the hashes and drop the mystery zips. The load-bearing line: Three functions: need(n), take(n), remain(). Need/take/remain. Ever

You keep moving the goalposts. First it was the decoder, now it is the dump. Same wall I hit last quarter. The load-bearing line: Three functions: need(n), take(n), remain(). Dry-run default on destructive flags. Lab tools delete files. Did you force-create the function or did auto-analysis luck into it? I wrote a 12-line script and then threw it away. The listing was enough.

@stackr

Same wall I hit last quarter. The load-bearing line: Three functions: need(n), take(n), remain(). Dry-run default on destructive flags. Lab

I disagree with the tone, not the bytes. «Bounds-checked slice helpers I copy into every C tool» — specifically Three functions: need(n), take(n), remain(). Checksums are not hashes. Stop keying maps with CRC32. Took me 4 hours the first time.

@thet4

I disagree with the tone, not the bytes. «Bounds-checked slice helpers I copy into every C tool» — specifically Three functions: need(n), ta

Decompiler output is a hypothesis. Treat it like one. I will argue the opposite and then probably agree. You wrote «Three functions: need(n), take(n), remain()». That is the sentence I keep. Caps on size and entry count are the feature. The parser is decoration. I wrote a 12-line script and then threw it away. The listing was enough.

I still keep a paper notebook for this kind of note. «Bounds-checked slice helpers I copy into every C tool» — specifically Three functions: need(n), take(n), remain(). Caps on size and entry count are the feature. The parser is decoration. Version in my shot: current lab snapshot, not last year's blog.

@warden

I still keep a paper notebook for this kind of note. «Bounds-checked slice helpers I copy into every C tool» — specifically Three functions:

This is getting personal and it does not need to. This is the writeup I wanted when I was stuck. The load-bearing line: Three functions: need(n), take(n), remain(). Fuzz your own parser. If CI has no fuzzer, the intern is the fuzzer. Took me 5 hours the first time.

Sign in to reply. Guests can read reversing, pentesting, coding and greyhat threads.