diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-06-14 18:07:37 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-06-14 18:07:37 +0200 |
| commit | e7b97f2edf17990be192d95ed42b2431b3060249 (patch) | |
| tree | 748cfb8bd7e01b59bc4c7c684d15824ff59c95fc /service | |
| parent | 1dae95e69db1ed2155599cfe582517307ebc1bcf (diff) | |
| download | enowars5-service-stldoctor-e7b97f2edf17990be192d95ed42b2431b3060249.tar.gz enowars5-service-stldoctor-e7b97f2edf17990be192d95ed42b2431b3060249.zip | |
mhash: fix empty input string problem with division by 0
Diffstat (limited to 'service')
| -rw-r--r-- | service/src/.gitignore | 1 | ||||
| -rw-r--r-- | service/src/util.c | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/service/src/.gitignore b/service/src/.gitignore deleted file mode 100644 index 378eac2..0000000 --- a/service/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build diff --git a/service/src/util.c b/service/src/util.c index d8b9c98..833c373 100644 --- a/service/src/util.c +++ b/service/src/util.c @@ -49,6 +49,7 @@ mhash(const char *str, int len) int i, k, v; char c, *bp; + if (!str || !*str) str = "."; if (len == -1) len = strlen(str); for (v = 0, i = 0; i < len; i++) v += str[i]; |
