git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34218e0
)
spoolss: allow truncated driver version in spoolss_driver_version_to_qword()
author
Günther Deschner
<gd@samba.org>
Fri, 11 Nov 2016 15:35:03 +0000
(16:35 +0100)
committer
Stefan Metzmacher
<metze@samba.org>
Thu, 12 Jan 2017 14:35:13 +0000
(15:35 +0100)
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>
source3/rpc_client/init_spoolss.c
patch
|
blob
|
history
diff --git
a/source3/rpc_client/init_spoolss.c
b/source3/rpc_client/init_spoolss.c
index d80d453fb23eaaf415dc4f388dd4ca13d2c5b565..a806fc6ce09a44be7a08de62cdfefee044c86105 100644
(file)
--- 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;
}