From fa1f11299e32d7886ef05bd9ff453a963069bbaa Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 15 May 2016 12:10:49 -0700 Subject: Fixed a bug in get_header_name that results in a crash if the "International Name" field is blank --- romdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'romdb.c') diff --git a/romdb.c b/romdb.c index 149814c..7fba5ef 100644 --- a/romdb.c +++ b/romdb.c @@ -418,7 +418,7 @@ char *get_header_name(uint8_t *rom) } } else { last++; - char *ret = malloc(last - (rom + TITLE_START) + 1); + char *ret = malloc(last - src + 1); uint8_t *dst; uint8_t last_was_space = 1; for (dst = ret; src < last; src++) -- cgit v1.2.3