Code Monkey home page Code Monkey logo

cmph's Introduction

cmph's People

Contributors

aerostitch avatar bonitao avatar dlight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pps83 taylorh140

cmph's Issues

Repository Description

It would great if you were provided little description or some tags or something like official mirror™ of cmph. Then it would be much more easier to find origins and obsolete mirrors of cmph do not get in top of search response.

Code is broken and does not build

I tried to compile the library and I get these errors:

1>sdbm_hash.c
1>C:\work\cmph-git\src\sdbm_hash.c(8,34): error C2065: 'CMPH_HASH_SDBM': undeclared identifier
1>C:\work\cmph-git\src\sdbm_hash.c(48,34): error C2065: 'CMPH_HASH_SDBM': undeclared identifier
1>fnv_hash.c
1>C:\work\cmph-git\src\fnv_hash.c(8,33): error C2065: 'CMPH_HASH_FNV': undeclared identifier
1>C:\work\cmph-git\src\fnv_hash.c(53,33): error C2065: 'CMPH_HASH_FNV': undeclared identifier
1>djb2_hash.c
1>C:\work\cmph-git\src\djb2_hash.c(7,24): error C2065: 'djb2_state': undeclared identifier
1>C:\work\cmph-git\src\djb2_hash.c(8,34): error C2065: 'CMPH_HASH_DJB2': undeclared identifier
1>C:\work\cmph-git\src\djb2_hash.c(48,34): error C2065: 'CMPH_HASH_DJB2': undeclared identifier
1>czech.c
1>c1 : fatal error C1083: Cannot open source file: 'src\czech.c': No such file or directory

There is no way for this code to compile. Can you please commit version that actually builds?

memcpy error in buffer_entry.c overflows destination keylen

The following memcpy() in buffer_entry.c is incorrect:

cmph_uint32 * keylen
[...]
memcpy(keylen + copied_bytes, buffer_entry->buff + buffer_entry->pos, (size_t)lacked_bytes);

Because cmph_uint32 has a length of 4 bytes, pointer arithmetic adds 4 bytes at a time, whereas copied_bytes is measured in bytes.

When copied_bytes is non-zero, the destination address for the memcpy is wrong resulting in stack corruption.

Therefore, it should be

memcpy((cmph_uint8 *)keylen + copied_bytes, buffer_entry->buff + buffer_entry->pos, (size_t)lacked_bytes);

It seems to be wrong in all branches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.