Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yacc reader.c substring doesnt null terminate #4796

Closed
vicuna opened this issue May 19, 2009 · 1 comment
Closed

yacc reader.c substring doesnt null terminate #4796

vicuna opened this issue May 19, 2009 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented May 19, 2009

Original bug ID: 4796
Reporter: @avsm
Status: closed (set by @damiendoligez on 2009-05-20T11:57:53Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Fixed in version: 3.11.1+dev
Category: ~DO NOT USE (was: OCaml general)

Bug description

We've had this patch in the OpenBSD port for a couple of years, and it's triggered with debug malloc flags which fill allocated memory with junk.

patch:
http://www.openbsd.org/cgi-bin/cvsweb/ports/lang/ocaml/patches/patch-yacc_reader_c?rev=1.2

--- yacc/reader.c.orig Thu Oct 6 07:34:51 2005
+++ yacc/reader.c Thu Nov 27 22:42:14 2008
@@ -163,6 +163,7 @@ char *substring (char *str, int start, int len)
for (i = 0; i < len; i++){
buf[i] = str[start+i];
}

  • buf[i] = '\0';
    return buf;
    }
@vicuna
Copy link
Author

vicuna commented May 20, 2009

Comment author: @damiendoligez

Thanks for the report. Your patch will be included in 3.11.1

@vicuna vicuna closed this as completed May 20, 2009
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant