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

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

Open
GoogleCodeExporter opened this issue Feb 4, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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

@GoogleCodeExporter
Copy link
Author

Thanks very much for taking the time to post the fix.

Original comment by [email protected] on 31 Jul 2014 at 2:12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant