Revision 58e3dd21f68c5eec945e7ddd4690733bd0103ce5 authored by Junio C Hamano on 11 December 2015, 19:14:38 UTC, committed by Junio C Hamano on 11 December 2015, 19:14:38 UTC
mark_tree_uninteresting() has code to handle the case where it gets
passed a NULL pointer in its 'tree' parameter, but the function had
'object = &tree->object' assignment before checking if tree is
NULL.  This gives a compiler an excuse to declare that tree will
never be NULL and apply a wrong optimization.  Avoid it.

* sn/null-pointer-arith-in-mark-tree-uninteresting:
  revision.c: fix possible null pointer arithmetic
2 parent s abca668 + a2678df
Raw File
blob.h
#ifndef BLOB_H
#define BLOB_H

#include "object.h"

extern const char *blob_type;

struct blob {
	struct object object;
};

struct blob *lookup_blob(const unsigned char *sha1);

int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size);

/**
 * Blobs do not contain references to other objects and do not have
 * structured data that needs parsing. However, code may use the
 * "parsed" bit in the struct object for a blob to determine whether
 * its content has been found to actually be available, so
 * parse_blob_buffer() is used (by object.c) to flag that the object
 * has been read successfully from the database.
 **/

#endif /* BLOB_H */
back to top