2,647 karma · joined March 24, 2012
What about mbedTLS (formerly PolarSSL)? It's dual licensed though.
https://code.google.com/p/address-sanitizer/(Apache 2.0)
https://code.google.com/p/include-what-you-use/ (same license as LLVM/Clang)
http://dotat.at/prog/unifdef/ (BSD)
http://gcc.godbolt.org/ (BSD)
https://tls.mbed.org/ (GPLv2)
Edit: midipix is something one should look out for. What it promises to support and how, sounds much more appealing to me than Cygwin or MinGW-w64, but it's still in early development: http://midipix.org/
I also didn't know that GNU refers to the MIT license as Expat license.
The list also links to several PDF versions of books that are still sold and also not published under a free license. Just mentioning them should be fine. We all know how to use an online search engine if we want to get a copy, don't we?
>MRI executes Ruby via an interpreted stack-machine bytecode language known as YARV (Yet Another Ruby VM) bytecode.
So YARV is a Ruby VM that has instructions and bytecode. Are you still confused?
I found this interesting article: http://daniel.haxx.se/blog/2014/10/25/pretending-port-zero-i...
So since 0 can be okay and (in_port_t)-1 (=65535) is okay, it has to be changed to return int and take a in_port_t* to be acceptable for you. The return value may not even matter if only AF_INET/AF_INET6 as family is possible - a comment could be of help here.
I couldn't find any function that returns 0 on failure. Or do you mean a null pointer?
>The stack should not be used to allocate buffers intended to hold data written by other routines for reasons that have become painfully clear over the last couple of years.
You want to see a zero tolerance policy for them? I think this is a bit overprotective. Their maximum size is usually known and all called functions take a size argument (snprintf(), strftime(), strlcpy(), etc.). There's a chance one could make a mistake here, but C is the wrong language to dynamically allocate everything. The probability to forget to free it, including in every error path, is much higher in my eyes. But then again, a memory leak is probably preferable than a buffer overflow (of course, both are bad). There are also already many heap allocated buffers.
>Looking a bit longer at the server_log code I think there may be a path to get a double free of 'ptr' where it is used first in the block with the while loop, then not reset to NULL and re-used in the second block and freed if it is not NULL (which it still is from the previous block...)
I don't think so, but that code really is dodgy. Also, `ptr != NULL` is unnecessary (just mentioning since OpenBSD/LibreSSL developers like to mention that too).
Can you tell me what comments you're expecting? qmail comes with a bunch of man pages (including ones for functions and they're well written). The file is called qmail-pw2u.c and there's qmail-pw2u(8). The function is called dosubuser, so let's look up subuser in it:
> Extra addresses. Each line has the form
> sub:user:pre:
That gives us a pretty good idea about the purpose of the posted code (plus the previous lines).
I agree, a function or macro makes sense (since there are many other equivalent constructs in the same file), but that's "just" giving a bunch of statement a name. Does field_next explain what they do?
static int field_next(int *i, char **x, unsigned *xlen) {
*++i; *x += *i; *xlen -= *i; *i = byte_chr(*x,*xlen,':');
return i == xlen;
}
/ * later */
if (field_next(&i, &x, &xlen)) return;
The rest of the function is writing something. Maybe we should find out the purpose of the program at first? The man page tells us this too:>qmail-pw2u reads a V7-format passwd file from standard input and prints a qmail-users-format assignment file.
void SimpleReferenceObject::operator delete[](void * /* pPtr */)
{
free(NULL);
}
What will cause the crash? Passing a null pointer to free() is fine. Something specific to C++?https://code.google.com/p/corkami/wiki/PE
https://code.google.com/p/corkami/wiki/PE101
https://code.google.com/p/corkami/wiki/PE102
It also has a section about the minimal size: https://code.google.com/p/corkami/wiki/PE#minimal_sizes
Modern Windows versions refuse to run the 97 b and 133 b files from the linked article.
https://github.com/golang/go/commit/6c7cbf086c34ebb88311ba12...
Yeah, using alloca() (in any form, incl. VLA) isn't good style. At least it's bounded, since filename_is_valid() checks the length. But it uses FILENAME_MAX, which could be too large for the stack.