Skip to content

ndk-build failure due to unsafe fprintf usage in tesseract source. #49

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Using android-ndk-r9 and the tesseract source code v3.02
2. ndk-build.cmd -j8
3.

What is the expected output? What do you see instead?

Expected successful build.  Build fails, error:

jni/com_googlecode_tesseract_android/src/dict/permdawg.cpp:208:62:      error: 
format not a string literal and no format arguments [-Werror=format-security]
cc1plus.exe: some warnings being treated as errors

Please provide any additional information below.

I fixed this by changing the line mentioned above:

jni/com_googlecode_tesseract_android/src/dict/permdawg.cpp:208:62

from:

    fprintf(output_ambig_words_file_, word_str.string());

to:

    fprintf(output_ambig_words_file_, "%s", word_str.string());

Simple enough.


Original issue reported on code.google.com by [email protected] on 4 Sep 2013 at 6:06

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions