Mercurial > hg > truffle
comparison src/share/vm/utilities/utf8.hpp @ 8851:8c03fc47511d
8011048: Possible reading from unmapped memory in UTF8::as_quoted_ascii()
Summary: Pass utf_length parameter to UTF8::as_quoted_ascii()
Reviewed-by: dcubed, minqi
author | iklam |
---|---|
date | Mon, 01 Apr 2013 14:05:41 -0700 |
parents | bd7a7ce2e264 |
children |
comparison
equal
deleted
inserted
replaced
8849:e458120c6e1a | 8851:8c03fc47511d |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
43 | 43 |
44 // returns the quoted ascii length of a utf8 string | 44 // returns the quoted ascii length of a utf8 string |
45 static int quoted_ascii_length(const char* utf8_str, int utf8_length); | 45 static int quoted_ascii_length(const char* utf8_str, int utf8_length); |
46 | 46 |
47 // converts a utf8 string to quoted ascii | 47 // converts a utf8 string to quoted ascii |
48 static void as_quoted_ascii(const char* utf8_str, char* buf, int buflen); | 48 static void as_quoted_ascii(const char* utf8_str, int utf8_length, char* buf, int buflen); |
49 | 49 |
50 // converts a quoted ascii string to utf8 string. returns the original | 50 // converts a quoted ascii string to utf8 string. returns the original |
51 // string unchanged if nothing needs to be done. | 51 // string unchanged if nothing needs to be done. |
52 static const char* from_quoted_ascii(const char* quoted_ascii_string); | 52 static const char* from_quoted_ascii(const char* quoted_ascii_string); |
53 | 53 |