Codebase list ohcount / 85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/main debian / patches / fix-buffer-overflow.patch
85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/main

Tree @85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/main (Download .tar.gz)

fix-buffer-overflow.patch @85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/mainraw · history · blame

Description: fix a buffer overflow due to an off-by one
 This manifests as a build failure on arm64 in Ubuntu.
Author: Steve Langasek <steve.langasek@ubuntu.com>
Last-Modified: 2018-04-07

Index: ohcount-3.1.0/src/diff.c
===================================================================
--- ohcount-3.1.0.orig/src/diff.c
+++ ohcount-3.1.0/src/diff.c
@@ -315,7 +315,7 @@ static int hash(char *line) {
 void prepare(int i, const char *buf) {
   struct line *p;
   int j;
-  char bufcpy[strlen(buf)];
+  char bufcpy[strlen(buf)+1];
   char *l;
 
   p = malloc(3*sizeof(struct line));