diff options
author | Günther Deschner <gd@samba.org> | 2016-11-11 16:35:03 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-01-12 15:35:13 +0100 |
commit | 03a4741bc768351334c92c8c7ddb0a4e84260c19 (patch) | |
tree | 639bd764fc27db2289270d3a52ddfbf7070801fe | |
parent | 34218e0448bca3fda9661c67f18bbd0b9886d079 (diff) | |
download | samba-03a4741bc768351334c92c8c7ddb0a4e84260c19.tar.gz |
spoolss: allow truncated driver version in spoolss_driver_version_to_qword()
This has been seen in real life Konica driver defintions.
Guenther
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r-- | source3/rpc_client/init_spoolss.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/rpc_client/init_spoolss.c b/source3/rpc_client/init_spoolss.c index d80d453fb23..a806fc6ce09 100644 --- a/source3/rpc_client/init_spoolss.c +++ b/source3/rpc_client/init_spoolss.c @@ -97,9 +97,11 @@ bool spoolss_timestr_to_NTTIME(const char *str, bool spoolss_driver_version_to_qword(const char *str, uint64_t *data) { - unsigned int v1, v2, v3, v4; + unsigned int v1, v2, v3, v4 = 0; - if (sscanf(str, "%u.%u.%u.%u", &v1, &v2, &v3, &v4) != 4) { + if ((sscanf(str, "%u.%u.%u.%u", &v1, &v2, &v3, &v4) != 4) && + (sscanf(str, "%u.%u.%u", &v1, &v2, &v3) != 3)) + { return false; } |